mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
don't split host if localhost
This commit is contained in:
parent
baddb93c4e
commit
588e650d80
1 changed files with 9 additions and 4 deletions
|
@ -728,11 +728,16 @@ func (c *Client) procesMessagePake(m message.Message) (err error) {
|
|||
log.Debugf("port: [%s]", c.Options.RelayPorts[i])
|
||||
go func(j int) {
|
||||
defer wg.Done()
|
||||
host, _, err := net.SplitHostPort(c.Options.RelayAddress)
|
||||
var host string
|
||||
if c.Options.RelayAddress == "localhost" {
|
||||
host = c.Options.RelayAddress
|
||||
} else {
|
||||
host, _, err = net.SplitHostPort(c.Options.RelayAddress)
|
||||
if err != nil {
|
||||
log.Errorf("bad relay address %s", c.Options.RelayAddress)
|
||||
return
|
||||
}
|
||||
}
|
||||
server := net.JoinHostPort(host, c.Options.RelayPorts[j])
|
||||
log.Debugf("connecting to %s", server)
|
||||
c.conn[j+1], _, _, err = tcp.ConnectToTCPServer(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue