mirror of
https://github.com/luscis/openlan.git
synced 2025-12-24 11:10:54 +08:00
fix: dstport for tcp link
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user