fix: dstport for tcp link
Some checks failed
Coverage CI / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
Ubuntu CI / build (push) Has been cancelled

This commit is contained in:
Daniel Ding
2025-12-09 11:10:19 +08:00
parent 834dae3d36
commit 918e58d66c
2 changed files with 6 additions and 1 deletions

View File

@@ -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)
}

View File

@@ -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,