|
|
. What follows is information for advanced users.'''
|
|
|
# How file transfers work
|
|
|
|
|
|
*Overview*
|
|
|
*What follows is information for advanced users.*
|
|
|
|
|
|
File Transfer support comes with Gajim 0.8. It is implemented by socks5 bytestreams ([XEP-0065](https://xmpp.org/extensions/xep-0065.html), [XEP-0096](https://xmpp.org/extensions/xep-0096.html), for information on file transfer over jingle: [wiki:JingleFileTransfer])
|
|
|
The main objective is to provide a way of exchanging files between users over a stream independent of the jabber servers, thus saving their resources.
|
|
|
## Overview
|
|
|
|
|
|
*The way it works*
|
|
|
File Transfer support is available since Gajim 0.8. It is implemented by socks5 bytestreams ([XEP-0065](https://xmpp.org/extensions/xep-0065.html) and [XEP-0096](https://xmpp.org/extensions/xep-0096.html). For information on file transfer over Jingle see: [Jingle File Transfer](./jinglefiletransfer).
|
|
|
|
|
|
First of all the initiator sends request for new file transfer, then recipient of the file should send its response (accept/deny) to the initiator.
|
|
|
In the next step the initiator of the file transfer (sender) posts iq with its own ip and list of socks5 proxy server. Then recipient tries to establish direct p2p connection to the sender. If it is impossible to do it recipient tries to connect to one of the socks5 proxies he got from the sender. If it succeeds it notifies the sender for the used proxy and file transfer can begin.
|
|
|
The main objective is to provide a way of exchanging files between users over a stream independent of the XMPP servers, thus saving their resources.
|
|
|
|
|
|
During the file transfer it is possible that connection to the peer or the socks5 proxy is lost or one of the peers cancels the transfer. In these cases both peers should be notified that file transfer cannot be completed.
|
|
|
### The way it works
|
|
|
|
|
|
*Possible problems and solutions*
|
|
|
First of all, the initiator sends a request for a new file transfer, then the recipient of the file should send its response (accept/deny) to the initiator.
|
|
|
|
|
|
In the next step the initiator of the file transfer (sender) posts an iq with its own IP and a list of socks5 proxy servers. Then the recipient tries to establish a direct p2p connection to the sender. If it turns out to be impossible to establish a direct p2p connection, the recipient tries to connect to one of the socks5 proxies he got from the sender. If it succeeds, it notifies the sender about the proxy being used, and the file transfer can begin.
|
|
|
|
|
|
1. Till the date of writing this wiki all socks5 proxy servers suffered from one problem:
|
|
|
It is impossible to send file over socks5 proxy if one of the peers contains non ascii characters in his jid or resource. In this case the contact that has such jid should change it and relogin to his server and then the transfer can be instantiated.
|
|
|
During the file transfer it is possible that the connection to the peer or the socks5 proxy is lost, or one of the peers cancels the transfer. In these cases both peers should be notified that the file transfer cannot be completed.
|
|
|
|
|
|
### Possible problems and solutions
|
|
|
|
|
|
2. File transfer port (7777) can be filtered by your [ISP](https://en.wikipedia.org/wiki/Internet_service_provider). You can check this by typing one of the following commands:
|
|
|
**Until the date of writing this wiki, all socks5 proxy servers suffered from one problem:**
|
|
|
|
|
|
It is impossible to send a file over socks5 proxy, if one of the peers contains non ascii characters in his jid or resource. In this case the contact that has a jid or resource containing non ascii characters should change it and relogin to his server. Only after that the transfer can be instantiated.
|
|
|
|
|
|
**File transfer port (7777) can be filtered by your [ISP](https://en.wikipedia.org/wiki/Internet_service_provider):**
|
|
|
|
|
|
You can check for filtering by typing one of the following commands:
|
|
|
|
|
|
telnet 208.245.212.98 7777
|
|
|
telnet 213.134.161.52 7777
|
|
|
telnet 129.16.79.37 7777
|
|
|
|
|
|
If connection cannot be established to any of the hosts then your computer is probably behind a [firewall](https://en.wikipedia.org/wiki/Firewall_%28networking%29) and this firewall filters port 7777. You can ask your ISP to open the port to the specific proxies that Gajim uses or you can try to find a proxy that listens on different port than 7777. List of jabber servers is available at [xmpp.net](https://xmpp.net/directory.php) .
|
|
|
The last star marks if server has proxy for file transfers.
|
|
|
Another posible solution is described below.
|
|
|
You also can open the [wiki:ACE] and simply change the value of key "file_transfers_port" to an allowed port.
|
|
|
If a connection cannot be established to any of the hosts then your computer is probably behind a [firewall](https://en.wikipedia.org/wiki/Firewall_%28networking%29) filtering port 7777. You can ask your ISP to open the port to the specific proxies that Gajim uses or you can try to find a proxy that listens on a different port than 7777.
|
|
|
|
|
|
A list of XMPP servers is available at [xmpp.net](https://xmpp.net/directory.php). The last star marks if server has proxy for file transfers.
|
|
|
|
|
|
**Another posible solution is described below:**
|
|
|
|
|
|
*Forward Port on Your Gateway/Router*
|
|
|
You can also open the [Advanced Configuration Editor](/help/ACE) and simply change the value of the key named "file_transfers_port" to an allowed port.
|
|
|
|
|
|
If you are behind [NAT](https://en.wikipedia.org/wiki/NAT) but you have access to your router you can forward the port so that your computer is accessible through the translated port on your router. Let's say your internal ip address is 10.10.10.1 and your router's real ip 1.2.3.4 then all you have to do is tell the router to forward all connection to 1.2.3.4 on port 28011 to 10.10.10.1:28011.
|
|
|
After that open advanced preferences (Preferences -> Advanced) and change the value of key "ft_override_host_to_send" to your real ip address (1.2.3.4) or if you have to the Hostname of your [Dynamic DNS](https://en.wikipedia.org/wiki/Dynamic_DNS)-Account.
|
|
|
**Forward port on your Gateway/Router**
|
|
|
|
|
|
_Sample port forward from 1.2.3.4:28011 to 10.10.10.1:28011 using iptables:_
|
|
|
If you are behind [NAT](https://en.wikipedia.org/wiki/NAT) but you have access to your router, you can forward the port so that your computer is accessible through the translated port on your router. Let's say your internal IP address is 10.10.10.1 and your router's real IP 1.2.3.4, then all you have to do is tell the router to forward all connections to 1.2.3.4 on port 28011 to 10.10.10.1:28011.
|
|
|
|
|
|
{{{
|
|
|
After that open [Advanced Configuration Editor](/help/ace) and change the value of the key named "ft_override_host_to_send" to your real IP address (1.2.3.4), or if you have to the Hostname of your [Dynamic DNS](https://en.wikipedia.org/wiki/Dynamic_DNS)-Account.
|
|
|
|
|
|
**Sample port forward**
|
|
|
|
|
|
Sample port forward from 1.2.3.4:28011 to 10.10.10.1:28011 using iptables:
|
|
|
|
|
|
```
|
|
|
iptables -t nat -A PREROUTING -p tcp -d 1.2.3.4 --dport 28011 -j DNAT --to-destination 10.10.10.1:28011
|
|
|
iptables -A FORWARD -p tcp --dport 28011 -j ACCEPT
|
|
|
}}}
|
|
|
```
|
|
|
|
|
|
See more info on [Port Forwarding](https://en.wikipedia.org/wiki/Port_forwarding)
|
|
|
and [iptables](https://en.wikipedia.org/wiki/Netfilter)
|
|
|
|
|
|
*Disable File Transfer Proxies*
|
|
|
|
|
|
Open [wiki:ACE], edit your account and under General tab, uncheck 'Use file transfer proxies'.
|
|
|
See more info on [port forwarding](https://en.wikipedia.org/wiki/Port_forwarding)
|
|
|
and [iptables](https://en.wikipedia.org/wiki/Netfilter).
|
|
|
|
|
|
**Disable File Transfer Proxies**
|
|
|
|
|
|
----
|
|
|
Open account preferences and uncheck 'Use file transfer proxies'.
|
|
|
|
|
|
If you have problems with file transfer between two Gajim users on [Windows](https://en.wikipedia.org/wiki/Windows) behind NAT please make sure you use 0.8.1 or higher where those problems are fixed
|
|
|
|
|
|
### Solving problems
|
|
|
|
|
|
----
|
|
|
If you find bugs or have ideas on how Gajim can be better, please open an [Issue](/help/howtocreateaticket).
|
|
|
|
|
|
If you find bugs or have ideas how Gajim can be better please send tickets in https://trac.gajim.org
|
|
|
|
|
|
### Tests
|
|
|
|
|
|
## tests
|
|
|
Here are the different tests we did about file transfer:
|
|
|
Here are the different tests we did for file transfers:
|
|
|
|
|
|
| || SI || Jingle |
|
|
|
|----------------------------------||-----------||------------|
|
|
|
| | IBB |Socks5| IBB |Socks5 |
|
|
|
|sender can be contacted directly | X | X | X | X |
|
|
|
|using sender proy | NA | X | NA | X |
|
|
|
|receiver can be contacted directly| NA | NA | NA | X |
|
|
|
|using receiver proxy | NA | NA | NA | X | |
|
|
| | **IBB (SI)** | **Socks5 (SI)** | **IBB (Jingle)** | **Socks5 (Jingle)** |
|
|
|
| -------------------------------- | ----- | --- | ---- | --- |
|
|
|
|Sender can be contacted directly | x | x | x | x |
|
|
|
|Using sender proy | na | x | na | x |
|
|
|
|Receiver can be contacted directly| na | na | na | x |
|
|
|
|Using receiver proxy | na | na | na | x | |