Exclude suspended servers from node client connectivity checks (#2672)
This commit is contained in:
1 parent
b7ea6d260c
commit
f64a167eea
1 file changed
+9
@@ -25,6 +25,15 @@
|
||||
reject(new Error('ws_error'));
|
||||
};
|
||||
|
||||
// Wings closes a suspended server's socket with 4409 before auth,
|
||||
// which still proves the websocket reached Wings
|
||||
ws.onclose = (event) => {
|
||||
if (event.code === 4409) {
|
||||
clearTimeout(timeout);
|
||||
resolve();
|
||||
}
|
||||
};
|
||||
|
||||
ws.onopen = () => {
|
||||
ws.send(JSON.stringify({ event: 'auth', args: ['{{ $wsToken }}'] }));
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user