-
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
Chat Example #311
Comments
The chat example actually listens on 0.0.0.0 (the global ip4 address) by default. |
but that's not the case for the sender, is it? wouldn't I have to set the public address for the sender address if I want to communicate over the internet? |
@agahEbrahimi yes. You can do that by specifying |
Hmm, it doesn't seem to be working, it gives |
Try this if you want to run it on a public network. Simple Case: Atleast one public IP Run this on a system with public IP address: ./chat -sp 3000 It should output something like this Now replace ./chat -d /ip4/<public_ip>/tcp/3000/ipfs/<node_id> on any system (public or private ip) Not so simple case: Different private networks |
I'm not requesting anything but having a chat example with both discovery and port mapping would be awesome (just as a suggestion). |
I'm currently working on a refactor that should make setting up port mapping easier. Once that gets merged, we can improve the examples. |
Awesome :) |
@Stebalien Would it be possible to share these changes? It would also be great if more NAT traversal techniques (NAT hole punching and STUN) are added to libp2p-nat. Let me know what do you think about it. |
Actually, I forgot. @jvsteiner already added a nice option for configuring NAT port mapping. Pass the We actually have three nat-traversal solutions at the moment:
|
FYI, I'm guessing one probably needs to use the routed host for some of those NAT techniques to work. |
@Stebalien Is go-libp2p/p2p/host/basic/basic_host.go Lines 50 to 51 in 3b8f227
libp2p uses https://github.com/fd/go-nat repo for NAT and I could only find NAT UPnP and NAT-PMP, could you please point me to STUN implementation used in libp2p. |
@Stebalien I think https://github.com/libp2p/go-reuseport is the repo for STUN but its not being used in libp2p. |
That option is (technically) deprecated but NATPortMap isn't. That comment is just telling you to configure the nat manager using the
It's used by |
@Stebalien Ok. Got it. Thanks. |
Hello,
I was wondering how I would be able to give a non local IP to the chat example. When running the executable, a port is given to it, but how would I be able to set it so that it works with the public IP and not the local IP (127.0.0.1).
Thank you in advance,
Agah Ebrahimi
The text was updated successfully, but these errors were encountered: