Fix duplicate port forwarding for statically forwarded ports (#163899)

* Fix duplicate port in view

* Include localhost address when resolving external
This commit is contained in:
Alex Ross
2022-10-18 20:08:21 +02:00
committed by GitHub
parent 58574650b6
commit b09701ac1b
3 changed files with 20 additions and 2 deletions

View File

@@ -473,6 +473,7 @@ export class TunnelModel extends Disposable {
this._register(this.tunnelService.onTunnelOpened(async (tunnel) => {
const key = makeAddress(tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort);
if (!mapHasAddressLocalhostOrAllInterfaces(this.forwarded, tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort)
&& !mapHasAddressLocalhostOrAllInterfaces(this.detected, tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort)
&& !mapHasAddressLocalhostOrAllInterfaces(this.inProgress, tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort)
&& tunnel.localAddress) {
const matchingCandidate = mapHasAddressLocalhostOrAllInterfaces(this._candidates ?? new Map(), tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort);