Hey,
Im working on a simple server/client application in Perl to ease transfering files between 2 persons. Im using Tk and Net::EasyTCP. A direct peer to peer connection is rather simple. But, problem accures when the persons are behind some kind of router or simular. I suspect it works nicely for messenger apps like msn and skype since they connect to a server first...
user#1 user#2 (local ip like: 192.168.0.34)
(192.168.0.54) |
| |
router/proxy router/proxy
| |
Internet Internet
\ /
------- -------
| |
Server
Pic 1.
and somehow the server redirects the data... (anyone know if the data send between the users goes through the server aswell or some kind of direct connection is created by server between the users? If so, how to do that?)
It seems to me that having some kind of server is quite the only way to make it possible to connect 2 users that are behind the internet by some router/proxy shown in Pic 1. But how do one take 2 sockets and join them (pipeing)?
Or, even better, its possible to join two users some way else? Basicly, Im trying to make the process 2 peers connect without too much hassle. Some folks don't even know what a FTP server is (yet install and use one), so I thought I create this "simple" tool. Just enter ip/dns and port to connect to. Where the other dude has the "server" running... Yes, one can use the messenger apps, but its too much work, if you wanna send many files... and I get rather slow speeds with them sometimes (so it does go through the server?).
I also suppose that the dude running the server may have to have port forwarding...
(Yea, sorry, not too much Perl related, although I do this in Perl)
Thanks,
Ace