Fix loop in port forwarding

This commit is contained in:
Alex Ross
2021-05-19 15:41:42 +02:00
parent 37a1181429
commit 53b58c89d4

View File

@@ -585,7 +585,7 @@ export class TunnelModel extends Disposable {
existingTunnel.name = attributes?.label ?? name;
this._onForwardPort.fire();
}
if (attributes?.protocol !== existingTunnel.localUri.scheme) {
if (attributes?.protocol && 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);
}