Project

General

Profile

Transfer file issue

Dmitry Anatolievich
Added over 4 years ago

Hello, everyone.

I try to send file from one contact to another. I use Psi as client. Please, see the file at the attachment.

My problem is that i have error: Unable to connect to peer for data transfer...

Should i set some specific setting for correct working of this functionality?

My init.properties file is:

config-type=--gen-config-def

--admins=admin@xmpp.dev.aaaaa.it

--virt-hosts=xmpp.dev.aaaaa.it

--debug=server

--user-db=mysql

--user-db-uri = jdbc:mysql://localhost/tigase?user=root&password=password

--auth-db = tigase-custom

--auth-db-uri = jdbc:mysql://localhost/vpopmail?user=test&password=test

--sm-plugins=+mobile_v2,+mobile_v3

--comp-name-1=proxy

--comp-class-1=tigase.socks5.Socks5ProxyComponent

basic-conf/auth-repo-params/conn-valid-query=select 1

basic-conf/auth-repo-params/init-db-query=

basic-conf/auth-repo-params/user-login-query={ call CustomTigUserLogin(?, ?) }

basic-conf/auth-repo-params/users-count-query=

basic-conf/auth-repo-params/add-user-query=

basic-conf/auth-repo-params/del-user-query=

basic-conf/auth-repo-params/update-password-query=

basic-conf/auth-repo-params/user-logout-query={ call CustomTigUserLogout(?) }

sess-man/plugins-conf/amp/msg-offline=true

sess-man/plugins-conf/jabber:iq:roster/dynamic-roster-classes=tigase.xmpp.it.inspect.ext.DynamicRosterPEC

sess-man/plugins-conf/jabber:iq:roster/db-uri=jdbc:mysql://localhost/vpopmail?user=test&password=test

sess-man/plugins-conf/presence/dynamic-roster-classes=tigase.xmpp.it.inspect.ext.DynamicRosterPEC

sess-man/plugins-conf/presence/db-uri=jdbc:mysql://localhost/vpopmail?user=test&password=test

Thx and best regards.


Replies (10)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 4 years ago

Hi,

Some XMPP client (Psi or Psi+ are examples) are not able to automatically discover availability of Socks5 proxy component so they cannot use it without proper configuration on client side. In account settings of your XMPP account in Psi on last tab (I think it is called Misc - it is tab where you can set name of resource used by XMPP connection) you will find Data transfer section with field labelled @Proxy@. In this field you need to put jid of your proxy component (proxy@xmpp.dev.aaaaa.it if I am right). When you tests with this settings then Psi would try to use proxy component. Without this setting Psi would not use proxy - would only try direct file transfer.

Added by Dmitry Anatolievich over 4 years ago

Hello, Andrzej.

Thx for your reply.

I tried to change Data Transfer section at the Misc tab of Psi. Please, see the attached file.

But i have the same error again.

To enable proxy i added to my init.properties two commands:

--comp-name-1=proxy

--comp-class-1=tigase.socks5.Socks5ProxyComponent

May be i should do something another to activate proxy?

Where can i see jid of my proxy component?

Thx and best regards.

Added by Dmitry Anatolievich over 4 years ago

Hello, Andrzej.

Do you have any another ideas, what i do wrong?

Because, i tried that you suggested. But it doesn't work for me.

It is very important for me.

I added the log from Psi XML Console for one of the user (from my first post).

Please, find it at the attachment.

Thx and best regards.

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 4 years ago

From attached dump of Psi XML console that Socks5 component properly responded and is configured properly but Psi decided to use direct connection as it discovered that it is in same private network (192.168..) but this connection failed. I suppose that it failed due to firewall on your computer or due to some issue with sending file from same Psi instance to same Psi instance.

So this really is not an issue with our Socks5 proxy component, but rather with Psi. I would suggest to try to send file between two different clients (ie. from Psi to Pidgin or the other way) as this may help and work. It is also possible that you would need to force them to use Socks5 proxy component (ie. by using clients connected to different subnets) which may force clients to use proxy as they will not be directly visible one to another.

Added by Dmitry Anatolievich over 4 years ago

Hello, Andrzej.

Thx for the reply.

In my case Firewall is disabled.

I tried to transfer file from Pidgin to Psi. And it works for me.

But when i tried to transfer file from Psi to Pidgin, i had the same error.

Please, see the attached log files.

What is wrong?

Also, please, say me, what i should set at the tab Misc of Psi?

Now i set proxy@xmpp.dev.aaaaa.it.

Thx and best regards.

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 4 years ago

I looked into attached logs and successful transfer (Pidgin to Psi) was established as Psi connected directly to port opened by Pidgin.

But connection failed when Psi was sending file to Pidgin - in this case Pidgin was not able to connect to port opened by Psi (I wonder why?) and was not able to use proxy as it returned some kind of error (but error is unreadable to me, maybe it is encoded in language native to your operating system?)

Below is part of Pidgin logs with unreadable part:

(13:59:48) proxy: Error connecting to 127.0.0.1:1080 (—ÓŚšŤŪŚŪŤŚ ÓÚ‚Śū„ŪůÚÓ.).
(13:59:48) proxy: Connection attempt failed: —ÓŚšŤŪŚŪŤŚ ÓÚ‚Śū„ŪůÚÓ.
(13:59:48) proxy: Connect Data is 0757EB58

Added by Dmitry Anatolievich over 4 years ago

Hello, Andrzej.

I translated log records for you.

(13:59:48) proxy: Error connecting to 127.0.0.1:1080 (Connect rejected.).

(13:59:48) proxy: Connection attempt failed: Connect rejected.

(13:59:48) proxy: Connect Data is 0757EB58

(13:59:48) proxy: Unable to connect to SOCKS5 host.

(13:59:48) jabber: si connection failed, jid was proxy@xmpp.dev.aaaaa.it, host was 127.0.0.1, error was Connect rejected.

(13:59:48) jabber: Sending (ssl) (dmitry@test-dmitry2.com.ua/tigase-1):

(13:59:48) jabber: jabber_si_bytestreams_attempt_connect: no streamhosts found, trying IBB

Any ideas?

Thx and best regards.

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 4 years ago

Are you running Tigase XMPP Server and Psi on same computer?

If not then on Tigase XMPP Server you have hostname misconfiguration as fully qualified hostname is resolved to 127.0.0.1 (localhost) while it should be resolved to external IP of server on which it is running, as IP got from resolution of this name are sent to client as IP to connect for establishing connection to proxy component. This will fail as 127.0.0.1 on client machine will point to client computer instead of server.

Added by Dmitry Anatolievich over 4 years ago

Hello, Andrzej.

Thx for your reply.

Yes, in my case the server and the Psi client are at different computers.

So, i tried to do, that you suggested. I added to init.properties file the next command:

proxy/component-id[S]=proxy@95.110.150.237

Now my settings for proxy component are:

--comp-name-1=proxy

--comp-class-1=tigase.socks5.Socks5ProxyComponent

proxy/component-id[S]=proxy@95.110.150.237

And now it works for me.

Thx a lot for your help!

*I have only one question. As you see from attached log file: first attempt was to 192.168.72.221:8010, it was unsuccessful. After this second attempt was to 95.110.150.237:1080 and it was successful.

So, why client connects to 192.168.72.221:8010 at first? How can i do, that client immediately connects to 95.110.150.237:1080? Or client defines automatically 192.168.72.221:8010 as connection?*

Added by Ganesh Krishnan over 3 years ago

This was 9 months ago and I am late for the party. But if I had to guess XMPP first tries to do a local connect to your client directly. If that fails it uses the proxy server to transfer the file.

The remote proxy server has standard port of 1080 but the local clients always have random ephemeral ports

    (1-10/10)