mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
Handle errors sent back over the sockt
This commit is contained in:
@@ -51,6 +51,10 @@ export class Websocket extends EventEmitter {
|
||||
setToken (token: string): this {
|
||||
this.token = token;
|
||||
|
||||
if (this.url) {
|
||||
this.send('auth', token);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -60,6 +64,8 @@ export class Websocket extends EventEmitter {
|
||||
}
|
||||
|
||||
close (code?: number, reason?: string) {
|
||||
this.url = null;
|
||||
this.token = '';
|
||||
this.socket && this.socket.close(code, reason);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user