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:
Jeremy Letto 2021-10-17 19:52:59 -05:00 committed by GitHub
parent f75ff2a7c8
commit 586f23cfa9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 568 additions and 77 deletions

View file

@ -69,14 +69,13 @@ export class WebClient {
SessionPersistence.updateStatus(status, description);
if (status === StatusEnum.DISCONNECTED) {
this.resetConnectionvars();
this.protobuf.resetCommands();
this.clearStores();
}
}
public resetConnectionvars() {
this.protobuf.resetCommands();
this.socket.keepAliveService.resetPingFlag();
public keepAlive(pingReceived: Function) {
this.protobuf.sendKeepAliveCommand(pingReceived);
}
private clearStores() {