-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hole Punching #806
Hole Punching #806
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## unstable #806 +/- ##
============================================
+ Coverage 84.20% 84.25% +0.04%
============================================
Files 90 91 +1
Lines 15239 15311 +72
============================================
+ Hits 12832 12900 +68
- Misses 2407 2411 +4
|
d8dac63
to
b8b8470
Compare
869d8d2
to
e7bb48d
Compare
ed00285
to
5bb56db
Compare
52af3ed
to
5331726
Compare
3cdf333
to
ddb5f33
Compare
ddb5f33
to
5f4745e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except #881
# Conflicts: # libp2p/multiaddress.nim # libp2p/protocols/connectivity/dcutr/client.nim # libp2p/protocols/connectivity/dcutr/core.nim # libp2p/protocols/connectivity/dcutr/server.nim # tests/testdcutr.nim # tests/testnative.nim
@Menduist the tests have been fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
This PR implements end-to-end TCP hole punching, integrating the previously implemented services (Autorelay and Autonat) and protocol (DCUtr) into the Hole Punching Service.
One of the Hole Punching service's responsibilities is to detect new relayed connections and try a unilateral connection upgrade if the remote peer has public dialable addresses. Otherwise, it tries to hole punch using the DCUtr protocol.
It also required changing how local ports are chosen when dialing peers. Previously, it was always chosen by the OS according to availability. This is still done when peer reachability is unknown or public, but the listening port is used instead when the peer is unreachable.