实验性 libp2p-webrtc-star 信令服务器是否只能在本地工作?

Do experimental libp2p-webrtc-star signaling server work only locally?

我正在使用此示例 https://github.com/libp2p/js-libp2p/tree/master/examples/libp2p-in-the-browser 并尝试通过给定的托管 rendezserver '/dns4/wrtc-star2.sjc.dwebops.[=16= 连接到 nodejs 对等点]' 。找到对等方但未建立连接。如果我 运行 nodejs 对等点与浏览器对等点在同一台机器上,则它们会连接,但如果 nodejs 对等点在不同的 machine/network 上,则对等点会找到对方,但不会连接。这正常吗?

是的,这完全正常。 WebRTC 只有在你可以通过 NAT 的情况下才能工作。 IPv6 确实也有助于 NAT 遍历,但对于 IPv4 可能会更棘手。所以它 比本地工作更多,但每个对等点必须能够直接联系到对方。

https://docs.ipfs.io/how-to/create-simple-chat-app/

We can use WebRTC-Star nodes to help discover other peers we can connect with directly browser-to-browser. If you're familiar with the concept of STUN, it might be helpful to think of them as conceptually similar. Effectively, each connecting node will be given a WebRTC-Star multiaddress that other nodes can use to discover and connect to your browser directly. This means that if you peer with someone using the star node, and the star node goes offline, you remain connected!

[...]

Tip

This is a very clean and effective method of P2P communications; however, sometimes NATs get in the way. We use p2p-circuit to get around that.