lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello.

   This sounds to me like the way hamachi or n2n software vpn work. In order to have a peer-2-peer communication between the peers which are located behind a NAT router/modem you will need to know each other's public IP address and then initiate a connection to that address.

   The statefull firewall on your modem/router will track this outgoing traffic (destination, port), so traffic originating from that location (destination, port) will be send to the host in the internal LAN.

   The trick is to be able to find out the remote end's IP. In order to do this, you will need a centralized server to which all peers will connect. This way the central server will know the public IP for each node. When a node request a connection to another peer the central server will pass the public IP and and port number to both peers for the target node.

   Have a look in this example here: http://www.rubyinside.com/skype-style-firewall-busting-with-ruby-and-udp-399.html


~stelios

On Fri, Feb 24, 2012 at 4:31 AM, Satheesh Kumar <satheeshrulzz@gmail.com> wrote:
Basically what I want need is this:

Two devices must connect and send data to one another(without an external server)  using tcp/udp.
The devices are behind NAT.
I read that this may be possible using a method called UDP Hole Punching.

So how do I achieve this? I have a server (seems hole punching requires a server) but the actual data transfer must be without using an external server.

Any help is appreciated.