-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
move NAT mapping logic out of the host, add tests for NAT handling #2248
Conversation
f071c82
to
c6c5099
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.
Couple comments, but looks good. Thanks for the tests!
continue | ||
} | ||
|
||
var ( |
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.
🙏 . Thanks for getting rid of this
cf2e70d
to
043162e
Compare
043162e
to
60e9ade
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.
Thanks for getting rid of the bash script :)
In preparation for #2229.
There's a few packages involved in NAT handling here:
p2p/net/nat
: Usesgo-nat
periodically renew NAT mappings and query for IP address changes.p2p/host/basic/natmgr.go
: Listens forListen
/ListenClose
notifications from the swarm and tries to obtain NAT mappings for our listen addresses. Provides aGetMapping(ma.Multiaddr) ma.Multiaddr
method that applies NAT mappings to existing multiaddresses.