Re: file transfer through NAT/firewall

"Peter Millard" <me-STcBuFROdrv2eFz/[email protected]> Tue, 12 Apr 2005 16:42:33 -0600
Newsgroups gmane.network.jabber.exodus.user
Message-ID <011001c53fb0$eb2c2520$e201020a@pmillard2k>
Damon Register wrote:
> Peter Millard wrote:
>> Exodus use two different ports (depending on what file xfer protocol is
>> being used).. 5280 is used for p2p HTTP transfers, and 5347 is used for
>> p2p JEP-65
> Thanks for your answer.  I wasn't aware that there were multiple
> methods.  What determines the method used?

Brace yourself :) Here goes:

Back in the mists of time.. there was no file transfer standard. What most
clients did was to use HTTP between 2 clients and just send a URL like:
http://192.168.1.4:5280/foo.gif. Where 192.168.1.4 was your IP. If folks could
not make a direct connection to your PC, you were SOL (ie, you couldn't send
files to that recipient).

With the advent of JEPs 65, 95 and 96, we now have a standard. JEP-65 allows
clients to make direct connections to each other using a SOCKS-like protocol and
exchange data. This is the preferred way. HOWEVER, the JEP also allows both the
sender and the recipient to connect to an intermediate proxy and exchange data
thru the proxy. This allows two clients who are both behind different NATs to
still send and receive files.

Exodus will automatically detect if the recipient supports JEP-65 style file
xfers. If it does't.. it just tries the old method using port 5280 to serve HTTP
requests from. If the recipient does support JEP-65, then Exodus will send it's
local info (IP=192.168.1.4, PORT=5347) *AND* any JEP-65 proxy info it
automatically discovered when it disco'd your server. For example, jabber.org
has a proxy which Exodus will automatically discover since it's a server of
jabber.org.

If you are in a private network, and all clients are behind the same firewall,
then you shouldn't have any problems. If you have clients behind various
firewalls, it's best to setup a proxy attached to your jabber server. This proxy
MUST be reachable by all of your clients in order for it to work.

So basically there are 2 options:

Recipient --- port 5347 ----> Sender   (this is p2p/peer 2 peer)

OR:

Recipient ----- XXX ----- some port ----> PROXY <---- some port ----
XXX ---Sender  (Use a proxy)

Where ---> shows outgoing TCP connects.
Where XXXX shows a NAT or firewall.

Hope all this helps.

pgm.