mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
parent
1255a79a57
commit
7fd8fda107
1 changed files with 5 additions and 1 deletions
|
@ -434,9 +434,13 @@ func (c *Client) Receive() (err error) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
log.Debug("switching to local")
|
log.Debug("switching to local")
|
||||||
|
portToUse := string(bytes.TrimPrefix(discoveries[0].Payload, []byte("croc")))
|
||||||
|
if portToUse == "" {
|
||||||
|
portToUse = "9009"
|
||||||
|
}
|
||||||
c.Options.RelayAddress = fmt.Sprintf("%s:%s",
|
c.Options.RelayAddress = fmt.Sprintf("%s:%s",
|
||||||
discoveries[0].Address,
|
discoveries[0].Address,
|
||||||
bytes.TrimPrefix(discoveries[0].Payload, []byte("croc")),
|
portToUse,
|
||||||
)
|
)
|
||||||
c.ExternalIPConnected = c.Options.RelayAddress
|
c.ExternalIPConnected = c.Options.RelayAddress
|
||||||
usingLocal = true
|
usingLocal = true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue