Skip to content

Commit

Permalink
Fix tunnel remote host (#133584)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexr00 authored Sep 22, 2021
1 parent d02c71b commit 7f6ab54
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vs/platform/remote/node/tunnelService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
Expand Down Expand Up @@ -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 = (<NodeSocket>protocol.getSocket()).socket;
const dataChunk = protocol.readEntireBuffer();
protocol.dispose();
Expand Down

1 comment on commit 7f6ab54

@debeer064
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.