Network communication over two private networks

I am trying to implement peer-to-peer communication.

I am using sockets to communicate between them. I want to know if there are any ways that I can use the same message when the two peers are behind two private networks (they don't know each other's public IP.) I can think of a shared buffer in good known place, means of communication. But is there any other way to do this?

+2


source to share


3 answers


You may also need to consider the case where the two peers don't even have public IP addresses, in which case you can use STUN to avoid the need for a central server. STUN is used effectively in products like Skype (I think), but at this stage it remains pretty black.

For a central approach, consider XMPP , of which ejabberd is a very popular implementation. There are other messaging protocols like the new AMPQ standard.



These technologies are likely to be more reliable and scalable than the home socket-based protocol.

+1


source


STUN and TURN are the usual ways to achieve this, as already posted, and are standards based. However, I have seen a very interesting approach to this using icmp posts recently. It's called pwnat and is available here



0


source


Since both are on different private networks, both peers cannot communicate with each other. You need to have a public server in order for you to establish a connection through that server. For more information see Resiprocate, Resiprocate

0


source







All Articles