transports: set handshake timeout of ws to 10s
This commit is contained in:
parent
6da3708cb9
commit
138636da69
@ -71,7 +71,10 @@ class WsOutbound extends _tcp.TcpOutbound {
|
||||
async _connect(target) {
|
||||
const address = this.getConnAddress(target);
|
||||
_utils.logger.info(`[${this.name}] [${this.remote}] connecting to ${address}`);
|
||||
const socket = new _ws2.default(address, this.getConnOptions({ perMessageDeflate: false }));
|
||||
const socket = new _ws2.default(address, this.getConnOptions({
|
||||
handshakeTimeout: 1e4,
|
||||
perMessageDeflate: false
|
||||
}));
|
||||
socket.on('message', this.onReceive);
|
||||
socket.on('close', () => socket.destroyed = true);
|
||||
return patchWebsocket.call(this, socket);
|
||||
|
@ -60,7 +60,10 @@ export class WsOutbound extends TcpOutbound {
|
||||
async _connect(target) {
|
||||
const address = this.getConnAddress(target);
|
||||
logger.info(`[${this.name}] [${this.remote}] connecting to ${address}`);
|
||||
const socket = new WebSocket(address, this.getConnOptions({ perMessageDeflate: false }));
|
||||
const socket = new WebSocket(address, this.getConnOptions({
|
||||
handshakeTimeout: 1e4, // 10s
|
||||
perMessageDeflate: false,
|
||||
}));
|
||||
socket.on('message', this.onReceive);
|
||||
socket.on('close', () => socket.destroyed = true);
|
||||
return patchWebsocket.call(this, socket);
|
||||
|
Loading…
Reference in New Issue
Block a user