testResolver: fix for tunnel server

This commit is contained in:
Martin Aeschlimann 2021-01-21 12:09:19 +01:00
parent b6f19ccf3f
commit 67bf6577b4

View file

@ -352,8 +352,9 @@ function tunnelFactory(tunnelOptions: vscode.TunnelOptions): Promise<vscode.Tunn
remoteSocket.pipe(proxySocket);
proxySocket.pipe(remoteSocket);
});
proxyServer.listen(tunnelOptions.localAddressPort === undefined ? 0 : tunnelOptions.localAddressPort + 1, () => {
proxyServer.listen(tunnelOptions.localAddressPort === undefined ? 0 : tunnelOptions.localAddressPort, () => {
const localPort = (<net.AddressInfo>proxyServer.address()).port;
console.log(`New tunnel server: Remote ${tunnelOptions.remoteAddress.port} -> local ${localPort}`);
const tunnel = newTunnel({ host: 'localhost', port: localPort });
res(tunnel);
});