Replies: 2 comments 5 replies
-
I am not sure what that would achieve. To test hole punching, you need two NATs. Inside a docker container, you only have a single interface by default. I am working on hole punching tests at the moment but those will likely run on bare Linux because I need to set up network namespaces myself.
If you are using the connection for something else, it should not be closed I believe.
You can wait for the hole-punch event and only then send the message although I don't think we currently have an API to specify, which connection the message should be sent on. You could manually close the relayed connection upon success and only then issue the request. It will then be sent on the only remaining, direct connection. |
Beta Was this translation helpful? Give feedback.
-
If youre polling swarm itself, you can wait for the event there thus queuing your message until there is a connection and a hole punch (if applicable), however for me i would rather just send the message through the relay regardless of if the hole punch or not since if it does, it will eventually upgrade the connections but if not, it would still utilize the relay, assuming the data is below the limit on the relay itself. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am trying to develop a peer to peer application using libp2p.
I am currently implementing the hole punching aspect and have several questions :
Is there a way to run the hole punching example inside Docker containers on the same machine ?
Is there an automatic fallback when hole punch fails ? In the specs, it say that the relay connection is still used but this is not what I observe in practice : the connection between the 2 peers is closed after several attempts.
I am using request response to send message from a peer to another. When calling send_request, it tries to dial the remote peer and when there is a connection, it sends a message, as described here. The issue is that, when a relayed circuit is established between 2 peers, the request will be sent directly and not wait until hole punching is performed. Can I tell request response to wait before sending the message ?
Thank you !
Beta Was this translation helpful? Give feedback.
All reactions