-
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
Dcutr #824
Dcutr #824
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## unstable #824 +/- ##
============================================
- Coverage 84.21% 84.21% -0.01%
============================================
Files 87 90 +3
Lines 15125 15239 +114
============================================
+ Hits 12738 12833 +95
- Misses 2387 2406 +19
|
Co-authored-by: diegomrsantos <diego@status.im>
import ./helpers | ||
|
||
type | ||
SwitchStub* = ref object of Switch |
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 will be moved to its own file in the HP PR.
|
||
if peerDialableAddrs.len > maxDialableAddrs: | ||
peerDialableAddrs = peerDialableAddrs[0..<maxDialableAddrs] | ||
var futs = peerDialableAddrs.mapIt(switch.connect(stream.peerId, @[it], forceDial = true, reuseConnection = false)) |
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.
Same as the other side
Co-authored-by: Tanguy <tanguy@status.im>
Co-authored-by: Tanguy <tanguy@status.im>
await conn.writeLp(pb.buffer) | ||
|
||
proc getHolePunchableAddrs*(addrs: seq[MultiAddress]): seq[MultiAddress] = | ||
addrs.filterIt(TCP.matchPartial(it)) |
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.
Not sure matchPartial is appropriate, it will also match WS addresses, no?
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.
Changed to match
.
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 expect last comment to check
This PR partially implements https://github.com/libp2p/specs/blob/master/relay/DCUtR.md. Currently, only the TCP protocol is supported. Additionally, the unilateral connection upgrade is handled by the Hole Punching service instead.