File transfer behind NAT

Hello,

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="john@myhost.com/Smack" from="simon@myhost.com/Smack" type="set">
     <query xmlns="http://jabber.org/protocol/bytestreams" sid="jsi_8447169958499417631" mode="tcp">
          <streamhost jid="simon@myhost.com/Smack" host="10.0.2.15" port="7777"/>
          <streamhost jid="proxy.myhost.com" host="127.0.0.1" port="7777"/>
     </query>
</iq>

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

<iq id="oXrAQ-35" to="john@myhost.com/Smack" type="set">
     <open xmlns="http://jabber.org/protocol/ibb" sid="jsi_8447169958499417631" block-size="4096"/>
</iq>

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?