lua-users home
lua-l archive

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




On 24/02/2012 1:31 PM, Satheesh Kumar 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.

Hi Satheesh,

Another name for "Nat Hole Punching" is "Nat Traversal", you'll find many links with a google search on that. E.g. lots of info here:

http://en.wikipedia.org/wiki/NAT_traversal
http://en.wikipedia.org/wiki/STUN

I havn't implemented this is Lua, but I have in other systems. You should be able to implement this with any API that gives you full control over the UDP socket (ability to bind the local port as well as set the remote port, maybe that's not even needed).

You will have varying success with the various protocols, depending on the routers. Some forms of NAT cannot be punched.

Ross.