diff --git a/src/vs/platform/remote/node/tunnelService.ts b/src/vs/platform/remote/node/tunnelService.ts index 11babe41f365259278206616805a9a7a100aee14..205582c16da100523724a42463a4009b8c6882df 100644 --- a/src/vs/platform/remote/node/tunnelService.ts +++ b/src/vs/platform/remote/node/tunnelService.ts @@ -56,7 +56,7 @@ class NodeRemoteTunnel extends Disposable implements RemoteTunnel { this._server.on('error', this._errorListener); this.tunnelRemotePort = tunnelRemotePort; - this.tunnelRemoteHost = (isLocalhost(tunnelRemoteHost) || isAllInterfaces(tunnelRemoteHost)) ? 'localhost' : tunnelRemoteHost; + this.tunnelRemoteHost = tunnelRemoteHost; } public override async dispose(): Promise { @@ -98,7 +98,8 @@ class NodeRemoteTunnel extends Disposable implements RemoteTunnel { // pause reading on the socket until we have a chance to forward its data localSocket.pause(); - const protocol = await connectRemoteAgentTunnel(this._options, this.tunnelRemoteHost, this.tunnelRemotePort); + const tunnelRemoteHost = (isLocalhost(this.tunnelRemoteHost) || isAllInterfaces(this.tunnelRemoteHost)) ? 'localhost' : this.tunnelRemoteHost; + const protocol = await connectRemoteAgentTunnel(this._options, tunnelRemoteHost, this.tunnelRemotePort); const remoteSocket = (protocol.getSocket()).socket; const dataChunk = protocol.readEntireBuffer(); protocol.dispose();