Pass the desired remote host in ITunnelConnectionStartParams

This commit is contained in:
Alex Dima 2021-08-23 14:33:06 +02:00
parent c8209aff4c
commit be7046f091
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
2 changed files with 4 additions and 3 deletions

View file

@ -354,6 +354,7 @@ async function doConnectRemoteAgentExtensionHost(options: ISimpleConnectionOptio
}
export interface ITunnelConnectionStartParams {
host: string;
port: number;
}
@ -427,9 +428,9 @@ export async function connectRemoteAgentExtensionHost(options: IConnectionOption
}
}
export async function connectRemoteAgentTunnel(options: IConnectionOptions, tunnelRemotePort: number): Promise<PersistentProtocol> {
export async function connectRemoteAgentTunnel(options: IConnectionOptions, tunnelRemoteHost: string, tunnelRemotePort: number): Promise<PersistentProtocol> {
const simpleOptions = await resolveConnectionOptions(options, generateUuid(), null);
const protocol = await doConnectRemoteAgentTunnel(simpleOptions, { port: tunnelRemotePort }, CancellationToken.None);
const protocol = await doConnectRemoteAgentTunnel(simpleOptions, { host: tunnelRemoteHost, port: tunnelRemotePort }, CancellationToken.None);
return protocol;
}

View file

@ -98,7 +98,7 @@ 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.tunnelRemotePort);
const protocol = await connectRemoteAgentTunnel(this._options, this.tunnelRemoteHost, this.tunnelRemotePort);
const remoteSocket = (<NodeSocket>protocol.getSocket()).socket;
const dataChunk = protocol.readEntireBuffer();
protocol.dispose();