File transfer behind NAT


I have two XMPP clients that use(and are based on) Smack library version 3.1.0. If they both are in the same network, then they transfer and receive files without any problems. But if one of them is behind NAT, then files just can’t be transferred.

For example John is on host A, he transfers a file to his client Simone on host B(Simone agrees to receive the file, request.accept() ).

“XMPPConnection.DEBUG_ENABLED = true” and I see in logs that in the beginning the host that’s trying to transfer the file tried to to that through socks proxy

<iq id="oXrAQ-34" to="" from="" type="set">
     <query xmlns="" sid="jsi_8447169958499417631" mode="tcp">
          <streamhost jid="" host="" port="7777"/>
          <streamhost jid="" host="" port="7777"/>

Of course Simone on host B can’t connect to and in a couple of seconds, John(host A) sends a request to start the transfer through IBB.

<iq id="oXrAQ-35" to="" type="set">
     <open xmlns="" sid="jsi_8447169958499417631" block-size="4096"/>

Simone on host B receives this message, but doesn’t respond at all. That’s why the file transfer through IBB doesn’t happen.

When I use the Smack Library version 3.2.0, there are no problems with the file transfer.

Can you please tell me what’s the solution in this situation?

Version 3.2.0 is still in Beta, I’m not sure that it’s ready to be used in production. Is there a way to solve this problem by using Smack version 3.2.1?