I have been trying to create a chat / file transfer application for several weeks. I spent several hours searching the Internet for a piece of code in punching UDP holes for work, but I did not find anything that works or is simple enough for me.
I am trying to connect two clients behind routers (NAT). I was able to configure a server that shares the IP addresses and ports of the two clients, but I was unable to initiate the connection. Is there any source code somewhere that I can use?
I found several STUN / ICE / TURN libraries, such as JStun, but there is no documentation on how to use them. Do I need a STUN server to start a connection? Can I use a public one, for example numb.viagenie.ca or http://www.stunserver.org/ ?
Any answers would be greatly appreciated. Thanks!
EDITOR: I had a bit more noise, and I found that STUN is pretty easy to do even through PHP. I created my own stunning PHP that simply shares the data of two clients. The hard part is connecting two clients, but it uses something called ICE. Thanks to selbie who posted this one in the comments. This led me to the right path with ICE. I will leave this question open longer if anyone comes up with anything else. Will I start coding my own ICE code or try to find something on the Internet. Thanks!
source share