mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
connect to socket server
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { SocketInterfaceService } from './interface/socket-interface.service'
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RocketChatClientService {
|
||||
|
||||
private SocketInterfaceService = new SocketInterfaceService()
|
||||
|
||||
constructor() {
|
||||
const url = environment.apiChatUrl.replace('https','wss')
|
||||
// this.SocketInterfaceService.connect(url);
|
||||
}
|
||||
|
||||
login(user) {
|
||||
const loginRequest = {
|
||||
msg: "method",
|
||||
method: "login",
|
||||
id: "42",
|
||||
params: [
|
||||
{
|
||||
"user": { "username": user.username },
|
||||
"password": {
|
||||
"digest": user.password,
|
||||
"algorithm":"sha-256"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
// this.SocketInterfaceService.send(loginRequest)
|
||||
}
|
||||
|
||||
logout(){ }
|
||||
|
||||
send(roomId, message, option) {}
|
||||
|
||||
receive() {}
|
||||
joinRoom(){}
|
||||
deleteMessage() {}
|
||||
|
||||
}
|
||||
|
||||
window['RocketChatClientService'] = new RocketChatClientService();
|
||||
Reference in New Issue
Block a user