From baddb93c4eee81a8b086c36cd2da7c8f3521cc6c Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 26 Aug 2020 14:56:57 -0700 Subject: [PATCH] local ipv6 works --- src/croc/croc.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index e278d728..38790b27 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -444,7 +444,7 @@ func (c *Client) Receive() (err error) { Limit: 1, Payload: []byte("ok"), Delay: 10 * time.Millisecond, - TimeLimit: 100 * time.Millisecond, + TimeLimit: 200 * time.Millisecond, }) if err1 == nil && len(ipv4discoveries) > 0 { dmux.Lock() @@ -459,7 +459,7 @@ func (c *Client) Receive() (err error) { Limit: 1, Payload: []byte("ok"), Delay: 10 * time.Millisecond, - TimeLimit: 100 * time.Millisecond, + TimeLimit: 200 * time.Millisecond, IPVersion: peerdiscovery.IPv6, }) if err1 == nil && len(ipv6discoveries) > 0 { @@ -483,10 +483,7 @@ func (c *Client) Receive() (err error) { if portToUse == "" { portToUse = "9009" } - c.Options.RelayAddress = fmt.Sprintf("%s:%s", - discoveries[0].Address, - portToUse, - ) + c.Options.RelayAddress = net.JoinHostPort(discoveries[0].Address, portToUse) c.ExternalIPConnected = c.Options.RelayAddress usingLocal = true break