libp2p / go-libp2p-examples

Example libp2p applications
MIT License
338 stars 145 forks source link

chat with mdns does not work on the internet #64

Open jeshocarmel opened 5 years ago

jeshocarmel commented 5 years ago

I'm trying to use chat-with-mdns with two instances in AWS. The default host 0.0.0.0 is applied and same ports used on both the instances. The ports are open to the public internet (verified) but the two don't seem to identify each other.

Am I missing something? Or this mdns discovery only works for local router setup only?

jeshocarmel commented 5 years ago

@bnsh12 any tip from you would be appreciated.

bineeshlazar commented 5 years ago

AFAIK we cannot use multicast in public internet. You might have to use DHT to find nodes in this scenario.

You can try private networking options like VPC to create a subnet in cloud, but I am not sure multicast will work there either.

jeshocarmel commented 5 years ago

Thanks for the info. I'm now using DHT to discover peers but that too is not working in the AWS public internet as the private IPs are the one being sent in MultiAddr[]

I think the only option is to create a VPC and do this

upperwal commented 5 years ago

@jeshocarmel

Thanks for the info. I'm now using DHT to discover peers but that too is not working in the AWS public internet as the private IPs are the one being sent in MultiAddr[]

DHT should work. Which example are you using and what is your setup?

jeshocarmel commented 5 years ago

I have a simple-bootstrap-node and two instances on AWS which are not connected locally. These two instances are able to connect to the bootstrap server individually but are not able to discover each other

upperwal commented 5 years ago

@jeshocarmel can you try this example and use peer argument to pass the multiaddr of your bootstrap node.