diff --git a/pkg/config/network.go b/pkg/config/network.go index 377d43e..1f6f804 100755 --- a/pkg/config/network.go +++ b/pkg/config/network.go @@ -197,12 +197,14 @@ func (n *Network) LoadOutput() { for _, link := range n.Links { link.Correct() username := UserShort(link.Username) + remote, port := SplitSecret(link.Connection) value := &Output{ Protocol: link.Protocol, - Remote: link.Connection, + Remote: remote, Secret: username + ":" + link.Password, Crypt: link.Crypt.Short(), } + fmt.Sscanf(port, "%d", &value.DstPort) if _, index := n.FindOutput(value); index == -1 { n.Outputs = append(n.Outputs, value) } diff --git a/pkg/switch/network_linux.go b/pkg/switch/network_linux.go index 7dfa102..2e01312 100755 --- a/pkg/switch/network_linux.go +++ b/pkg/switch/network_linux.go @@ -221,6 +221,9 @@ func (w *WorkerImpl) addOutput(bridge string, port *co.Output) { Username: name, Password: pass, } + if port.DstPort != 0 { + ac.Connection = fmt.Sprintf("%s:%d", port.Remote, port.DstPort) + } if secret != "" { ac.Crypt = &co.Crypt{ Algo: algo,