Standalone Peer Behind NAT Communicating with Browser via WebRTC – Issues with Private IP and AutoNATv2 #5862
Unanswered
cr-RonZigelman
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I am trying to implement communication between a standalone peer (behind NAT, in Network 1) and a browser (also behind NAT, in Network 2) using WebRTC. My goal is for the standalone peer to connect to the browser peer, even though both are behind NATs in separate networks.
I started with the example in libp2p's repository for browser-webrtc: browser-webrtc example. This worked fine when both peers were on the same network. However, when I moved the server to a machine with a public IP, the following issues arose:
The client (browser) could successfully connect to the server's web server.
The ping failed because the client was trying to communicate with the server’s private address, not the public one.
Attempts to Resolve:
I tried manually adding the server's public IP to the swarm via swarm.add_external_address(), but the behavior did not change. The client still tried to ping the private address.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions