transports: log host and resolved ip separately

This commit is contained in:
Micooz 2017-10-14 22:51:43 +08:00
parent 8c87a360d5
commit 801dd69867
2 changed files with 2 additions and 6 deletions

@ -163,12 +163,10 @@ export class TcpInbound extends Inbound {
onPresetPauseRecv() {
__IS_SERVER__ && (this._socket && this._socket.pause())
//(this._fsocket && this._fsocket.pause());
}
onPresetResumeRecv() {
__IS_SERVER__ && (this._socket && this._socket.resume());
//(this._fsocket && this._fsocket.resume());
}
}
@ -282,12 +280,10 @@ export class TcpOutbound extends Outbound {
onPresetPauseSend() {
__IS_SERVER__ && (this._socket && this._socket.pause());
//(this._bsocket && this._bsocket.pause());
}
onPresetResumeSend() {
__IS_SERVER__ && (this._socket && this._socket.resume());
//(this._bsocket && this._bsocket.resume());
}
async connect({host, port}) {
@ -308,7 +304,7 @@ export class TcpOutbound extends Outbound {
async _connect({host, port}) {
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});
}

@ -242,7 +242,7 @@ export class WsOutbound extends Outbound {
} catch (err) {
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) => {
this._ws = new WebSocket(`ws://${host}:${port}`, {
perMessageDeflate: false