mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Webatrice websocket refactor (#4435)
* add unit tests for websocket events * add unit tests for KeepAliveService, clean up keepAlive termination flow * put keepAlive command in protobuf service and expose thru webClient * secure wss * rename files tsx to ts * add localhost support for ws/wss connection Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
f75ff2a7c8
commit
586f23cfa9
15 changed files with 568 additions and 77 deletions
|
|
@ -65,6 +65,14 @@ export class ProtobufService {
|
|||
}
|
||||
}
|
||||
|
||||
public sendKeepAliveCommand(pingReceived: Function) {
|
||||
const command = this.controller.SessionCommand.create({
|
||||
".Command_Ping.ext" : this.controller.Command_Ping.create()
|
||||
});
|
||||
|
||||
this.sendSessionCommand(command, pingReceived);
|
||||
}
|
||||
|
||||
public handleMessageEvent({ data }: MessageEvent): void {
|
||||
try {
|
||||
const uint8msg = new Uint8Array(data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue