mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
local ipv6 works
This commit is contained in:
parent
c9a58513e1
commit
baddb93c4e
1 changed files with 3 additions and 6 deletions
|
@ -444,7 +444,7 @@ func (c *Client) Receive() (err error) {
|
||||||
Limit: 1,
|
Limit: 1,
|
||||||
Payload: []byte("ok"),
|
Payload: []byte("ok"),
|
||||||
Delay: 10 * time.Millisecond,
|
Delay: 10 * time.Millisecond,
|
||||||
TimeLimit: 100 * time.Millisecond,
|
TimeLimit: 200 * time.Millisecond,
|
||||||
})
|
})
|
||||||
if err1 == nil && len(ipv4discoveries) > 0 {
|
if err1 == nil && len(ipv4discoveries) > 0 {
|
||||||
dmux.Lock()
|
dmux.Lock()
|
||||||
|
@ -459,7 +459,7 @@ func (c *Client) Receive() (err error) {
|
||||||
Limit: 1,
|
Limit: 1,
|
||||||
Payload: []byte("ok"),
|
Payload: []byte("ok"),
|
||||||
Delay: 10 * time.Millisecond,
|
Delay: 10 * time.Millisecond,
|
||||||
TimeLimit: 100 * time.Millisecond,
|
TimeLimit: 200 * time.Millisecond,
|
||||||
IPVersion: peerdiscovery.IPv6,
|
IPVersion: peerdiscovery.IPv6,
|
||||||
})
|
})
|
||||||
if err1 == nil && len(ipv6discoveries) > 0 {
|
if err1 == nil && len(ipv6discoveries) > 0 {
|
||||||
|
@ -483,10 +483,7 @@ func (c *Client) Receive() (err error) {
|
||||||
if portToUse == "" {
|
if portToUse == "" {
|
||||||
portToUse = "9009"
|
portToUse = "9009"
|
||||||
}
|
}
|
||||||
c.Options.RelayAddress = fmt.Sprintf("%s:%s",
|
c.Options.RelayAddress = net.JoinHostPort(discoveries[0].Address, portToUse)
|
||||||
discoveries[0].Address,
|
|
||||||
portToUse,
|
|
||||||
)
|
|
||||||
c.ExternalIPConnected = c.Options.RelayAddress
|
c.ExternalIPConnected = c.Options.RelayAddress
|
||||||
usingLocal = true
|
usingLocal = true
|
||||||
break
|
break
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue