-
Notifications
You must be signed in to change notification settings - Fork 25
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
network: support for uPnP and PMP nat traversal #1050
Conversation
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.
Made some minor suggestions but otherwise looks good to me. As soon as the CI issue is fixed, I think we're good to go.
fbcf01e
to
b387b6a
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.
We're close now.
@veaceslavdoina @benbierens Rahul is making some changes to the way NAT parameters work, we should make sure that all users of those (e.g. testnet deployers, disttests deployers) are not gonna fall apart, would be good to have your eyes here. |
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.
Looks good as far as I'm concerned.
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.
Looks good, I tested this and it seems to work fine with PMP on my network. Only request is to address the several style comments that I left, other than that, it's good to go.
codex/utils/addrutils.nim
Outdated
else: | ||
none(Port) | ||
|
||
result = (ip: ip, port: port) |
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.
Setting result explicitly is usually unnecessary (and in fact, can cause issues under certain condition). Nim will return whatever the result of the last evaluation of the selected codepath is.
result = (ip: ip, port: port) | |
(ip: ip, port: port) |
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.
Gotcha. commit
codex/nat.nim
Outdated
of true: extIp*: ValidIpAddress | ||
of false: nat*: NatStrategy | ||
|
||
func parseCmdArg*(T: type NatConfig, p: string): T {.raises: [ValueError].} = |
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.
By convention, we keep this in the conf.nim
.
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.
- remove Disc_ip env - update CODE_NAT parsing logic
2bae744
to
0934e59
Compare
If you're done addressing the comments, @munna0908, feel free to merge. |
This PR introduces support for new NAT traversal techniques. Issue: #905
Changes Include
nat
CLI flag: Allowing users to select from various options for determining the public address. The available options are:disc-ip
flag: The IP address will now be automatically parsed from the provided listener address