diff --git a/main.go b/main.go index 2172a6a..8129d4a 100644 --- a/main.go +++ b/main.go @@ -348,11 +348,10 @@ func updateTargets(pm *proxy.ProxyManager, action string, tunnelIP string, proto if action == "add" { target := parts[1] + ":" + parts[2] - pm.RemoveTarget(proto, tunnelIP, port) // remove it first incase this is an update. we are kind of using the internal port as the "targetId" in the proxy + pm.RemoveTarget(proto, tunnelIP, port) // remove it first in case this is an update. we are kind of using the internal port as the "targetId" in the proxy pm.AddTarget(proto, tunnelIP, port, target) - // log the target - log.Printf("Added target: %s:%d -> %s", tunnelIP, port, target) } else if action == "remove" { + log.Printf("Removing target with port %d", port) pm.RemoveTarget(proto, tunnelIP, port) } } diff --git a/proxy/manager.go b/proxy/manager.go index e54c312..2f4975a 100644 --- a/proxy/manager.go +++ b/proxy/manager.go @@ -46,7 +46,7 @@ func (pm *ProxyManager) RemoveTarget(protocol, listen string, port int) error { target.Port == port && strings.ToLower(target.Protocol) == protocol { // Signal the serving goroutine to stop - close(target.cancel) + // close(target.cancel) // Close the appropriate listener/connection based on protocol target.Lock()