Skip to content

Hole punching #2556

Answered by sukunrt
kehiy asked this question in Q&A
Sep 4, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

you can do libp2p.New(EnableHolePunching(), otherOpts...)

Within libp2p, we have a bunch of tests that ensure that hole punching is doing what we want it to. These don't exactly simulate nodes behind NAT/firewall but mock only enough that we have high confidence that we're doing the right thing in most cases.

For really testing NAT traversal in unit tests you'll need to do a lot more work.
There is a draft PR that introduces such tests for hole punching. #2443 but I have no plans right now to polish it and make it reviewable. I do not see myself getting back to it for the next month. However you can see how I use the tailscale natlab package to configure hosts that appear to be behind a N…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@kehiy
Comment options

@sukunrt
Comment options

Answer selected by kehiy
@kehiy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants