transports: log host and resolved ip separately
This commit is contained in:
parent
8c87a360d5
commit
801dd69867
@ -163,12 +163,10 @@ export class TcpInbound extends Inbound {
|
|||||||
|
|
||||||
onPresetPauseRecv() {
|
onPresetPauseRecv() {
|
||||||
__IS_SERVER__ && (this._socket && this._socket.pause())
|
__IS_SERVER__ && (this._socket && this._socket.pause())
|
||||||
//(this._fsocket && this._fsocket.pause());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onPresetResumeRecv() {
|
onPresetResumeRecv() {
|
||||||
__IS_SERVER__ && (this._socket && this._socket.resume());
|
__IS_SERVER__ && (this._socket && this._socket.resume());
|
||||||
//(this._fsocket && this._fsocket.resume());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -282,12 +280,10 @@ export class TcpOutbound extends Outbound {
|
|||||||
|
|
||||||
onPresetPauseSend() {
|
onPresetPauseSend() {
|
||||||
__IS_SERVER__ && (this._socket && this._socket.pause());
|
__IS_SERVER__ && (this._socket && this._socket.pause());
|
||||||
//(this._bsocket && this._bsocket.pause());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onPresetResumeSend() {
|
onPresetResumeSend() {
|
||||||
__IS_SERVER__ && (this._socket && this._socket.resume());
|
__IS_SERVER__ && (this._socket && this._socket.resume());
|
||||||
//(this._bsocket && this._bsocket.resume());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async connect({host, port}) {
|
async connect({host, port}) {
|
||||||
@ -308,7 +304,7 @@ export class TcpOutbound extends Outbound {
|
|||||||
|
|
||||||
async _connect({host, port}) {
|
async _connect({host, port}) {
|
||||||
const ip = await this._dnsCache.get(host);
|
const ip = await this._dnsCache.get(host);
|
||||||
logger.info(`[tcp:outbound] [${this.remote}] connecting to: ${host}(${ip}):${port}`);
|
logger.info(`[tcp:outbound] [${this.remote}] connecting to: ${host}:${port} resolve=${ip}`);
|
||||||
return net.connect({host: ip, port});
|
return net.connect({host: ip, port});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ export class WsOutbound extends Outbound {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error(`[ws:outbound] [${this.remote}] fail to resolve host ${host}: ${err.message}`);
|
logger.error(`[ws:outbound] [${this.remote}] fail to resolve host ${host}: ${err.message}`);
|
||||||
}
|
}
|
||||||
logger.info(`[ws:outbound] [${this.remote}] connecting to: ws://${ip}:${port}`);
|
logger.info(`[ws:outbound] [${this.remote}] connecting to: ws://${host}:${port} resolve=${ip}`);
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
this._ws = new WebSocket(`ws://${host}:${port}`, {
|
this._ws = new WebSocket(`ws://${host}:${port}`, {
|
||||||
perMessageDeflate: false
|
perMessageDeflate: false
|
||||||
|
Loading…
Reference in New Issue
Block a user