mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
Close and reopen tunnel when protocol changes
This commit is contained in:
@@ -583,11 +583,12 @@ export class TunnelModel extends Disposable {
|
||||
} else {
|
||||
if (attributes?.label ?? name) {
|
||||
existingTunnel.name = attributes?.label ?? name;
|
||||
this._onForwardPort.fire();
|
||||
}
|
||||
if (attributes?.protocol) {
|
||||
existingTunnel.localUri = this.makeLocalUri(existingTunnel.localAddress, attributes);
|
||||
if (attributes?.protocol !== existingTunnel.localUri.scheme) {
|
||||
await this.close(existingTunnel.remoteHost, existingTunnel.remotePort);
|
||||
await this.forward({ host: existingTunnel.remoteHost, port: existingTunnel.remotePort }, local, name, source, elevateIfNeeded, isPublic, restore, attributes);
|
||||
}
|
||||
this._onForwardPort.fire();
|
||||
return mapHasAddressLocalhostOrAllInterfaces(this.remoteTunnels, remote.host, remote.port);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user