For peer-to-peer connectivity within a LAN, the sender and receiver d…#1022
Merged
schollz merged 1 commit intoschollz:mainfrom Dec 23, 2025
Merged
For peer-to-peer connectivity within a LAN, the sender and receiver d…#1022schollz merged 1 commit intoschollz:mainfrom
schollz merged 1 commit intoschollz:mainfrom
Conversation
…on't need to be on the same subnet. Even with NAT routers in their respective local networks, a receiver behind NAT can establish direct access to the sender without requiring internet connectivity. Conversely, the local networks on the sender and receiver may overlap but not be connected. This often occurs with 192.168.0.0/30 and 192.168.1.0/30 subnets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…on't need to be on the same subnet.
Even with NAT routers in their respective local networks, a receiver behind NAT can establish direct access to the sender without requiring internet connectivity. Conversely, the local networks on the sender and receiver may overlap but not be connected. This often occurs with 192.168.0.0/24 and 192.168.1.0/24 subnets.
Please look:
`---before
[debug] 11:31:12 croc.go:1059: ips data: ["9009","x.y.z.189","192.168.0.189"]
[debug] 11:31:12 croc.go:1071: ipv4Add4: x.y.z.189, ipv4Net: x.y.z.0/24, err:
[debug] 11:31:12 croc.go:1076: localIP: 192.168.0.12, localIPparsed: 192.168.0.12
[debug] 11:31:12 croc.go:1076: localIP: 172.17.0.1, localIPparsed: 172.17.0.1
[debug] 11:31:12 croc.go:1084: x.y.z.189 is not a local IP, skipping
[debug] 11:31:12 croc.go:1079: ip: 192.168.0.189 is a local IP
[debug] 11:31:12 comm.go:78: dialing to 192.168.0.189:9009 with timelimit 500ms
[debug] 11:31:13 comm.go:83: comm.NewConnection failed: dial tcp 192.168.0.189:9009: i/o timeout
[debug] 11:31:13 tcp.go:493: comm.NewConnection failed: dial tcp 192.168.0.189:9009: i/o timeout
[debug] 11:31:13 croc.go:1091: comm.NewConnection failed: dial tcp 192.168.0.189:9009: i/o timeout
[debug] 11:31:13 croc.go:1092: could not connect to 192.168.0.189:9009
---after
[debug] 15:41:14 croc.go:1047: sending ips?
[debug] 15:41:14 croc.go:1059: ips data: ["9009","x.y.z.189","192.168.0.189"]
[debug] 15:41:14 croc.go:1071: ipv4Add4: x.y.z.189, ipv4Net: x.y.z.0/24, err:
[debug] 15:41:14 comm.go:78: dialing to x.y.z.189:9009 with timelimit 500ms
[debug] 15:41:14 comm.go:87: connected to 'x.y.z.189:9009'
[debug] 15:41:14 tcp.go:523: strong key: e56b5ac21f926e52b551385f81f89ed709151e3cddfd1de61a9ddbc31fa324ff
[debug] 15:41:14 tcp.go:537: sending password
[debug] 15:41:14 tcp.go:548: waiting for first ok
[debug] 15:41:14 tcp.go:566: sending room; 420d6ae6859531b625e93e6aac0c26316b3f2ba83358af048f6c71607325e4ad
[debug] 15:41:14 tcp.go:577: waiting for room confirmation
[debug] 15:41:14 tcp.go:593: all set
[debug] 15:41:14 croc.go:1100: local connection established to x.y.z.189:9009
[debug] 15:41:14 croc.go:1101: banner: 9010,9011,9012
`