Not logged in. · Lost password · Register
Forum: agsXMPP RSS
file transfer problem1
Page:  1  2  next
Avatar
rose5178 #1
Member since Mar 2008 · 14 posts
Group memberships: Members
Show profile · Link to this post
Subject: file transfer problem1
Hello,everyone!
I have problems as follow :
I want to make a IM client which can transfer files between two NAT client.

1, I find that "spark" do that with XPE0047(IBB),but after I read some topics in this forum,I think XEP0056 can do it with socks 5 proxy ,is it? why "spark" do that with XPE0047(IBB)? Can't XEP0065 do it?

2. I make my IM with XEP0065 (use socks 5 proxy).It  has error as :server not found.
This post was edited on 2008-04-24, 02:49 by rose5178.
Avatar
Jabberer #2
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
you mean XEP-0065 SOCKS5 Bytestreams, not 56.

There are many different ways to transfer files with XMPP. Bytestreams and IBB are 2 of them.
I don't know how Spark is sending files. If both clients are behind NAT then the only way is IBB or SOCKS5 over proxy.

  • Are you using a bytestream proxy?
  • If yes, can both clients connect to the proxy?
Software Developer
AG-Software
Avatar
rose5178 #3
Member since Mar 2008 · 14 posts
Group memberships: Members
Show profile · Link to this post
thanks,jabberer:

I find my problem : port 5269 is not open.
This post was edited 2 times, last on 2008-04-24, 04:05 by rose5178.
Avatar
rose5178 #4
Member since Mar 2008 · 14 posts
Group memberships: Members
Show profile · Link to this post
I find a new problem:

I used Two miniclient(in agsXMPP1.00,vs2005).
My debug is :
SEND: <iq id="agsXMPP_11" to="228@218.*.*.*/d07ef0f2" type="set"><si

xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer"

id="1ace5a3f-f3ce-411f-a9f9-54d90b19f034"><file xmlns="http://jabber.org/protocol/si/profile/file-

transfer" name="address.xml" size="86"><range /></file><feature

xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="form"><field

type="list-single" var="stream-

method"><option><value>http://jabber.org/protocol/bytestreams</value></option></field></x></feature>

</si></iq>
RECV: <iq xmlns="jabber:client" from="228@218.*.*.*/d07ef0f2"

to="00_90000238@218.*.*.*/87e72989" type="result" id="agsXMPP_11"><si

xmlns="http://jabber.org/protocol/si" id="1ace5a3f-f3ce-411f-a9f9-54d90b19f034"><feature

xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="submit"><field

var="stream-

method"><value>http://jabber.org/protocol/bytestreams</value></field></x></feature></si></iq>
[color=crimson]SEND[/color]: <iq id="agsXMPP_12" to="228@218.*.*.*/d07ef0f2" type="set"><query

xmlns="http://jabber.org/protocol/bytestreams" sid="1ace5a3f-f3ce-411f-a9f9-54d90b19f034"

mode="tcp"><streamhost jid="00_90000238@218.*.*.*/87e72989" host="192.168.0.228" port="7777"

/><streamhost jid="proxy.netlab.cz" host="proxy.netlab.cz" port="7777" /></query></iq>
[color=deepskyblue]RECV[/color]: <iq xmlns="jabber:client" from="228@218.*.*.*/d07ef0f2"

to="00_90000238@218.*.*.*/87e72989" type="result" id="agsXMPP_12"><query

xmlns="http://jabber.org/protocol/bytestreams"><streamhost-used jid="proxy.netlab.cz"

/></query></iq>
SEND: <iq id="agsXMPP_13" to="proxy.netlab.cz" type="set"><query

xmlns="http://jabber.org/protocol/bytestreams" sid="1ace5a3f-f3ce-411f-a9f9-

54d90b19f034"><activate>228@218.*.*.*/d07ef0f2</activate></query></iq>
[color=deepskyblue]RECV[/color]: <iq xmlns="jabber:client" from="proxy.netlab.cz" to="00_90000238@218.*.*.*/87e72989"

type="error" id="agsXMPP_13"><query xmlns="http://jabber.org/protocol/bytestreams" sid="1ace5a3f-

f3ce-411f-a9f9-54d90b19f034" /><error code="404" type="cancel"><item-not-found

xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>

I want to know what's wrong with it .
The server is openfire.
This post was edited on 2013-03-06, 19:12 by Alex.
Avatar
Alex #5
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by rose5178:
<iq id="agsXMPP_11" to="228@218.*.*.*/d07ef0f2" type="set">
configure your Openfire server correct and don't use Ip addresses. XMPP needs domains.

Quote by rose5178:
<streamhost jid="proxy.netlab.cz" host="proxy.netlab.cz" port="7777" />
use the proxy from your Openfire, and not some other proxy in the internet, here from netlab.cz

Alex
Avatar
rose5178 #6
Member since Mar 2008 · 14 posts
Group memberships: Members
Show profile · Link to this post
I use the "proxy.jabber.org" as PROXY ,and two client can transfer files. But use my openfire's proxy is an error as fallow:

SEND: <iq id="agsXMPP_9" to="00_90000238@218.*.*.*/3a547429" type="set"><si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer" id="2bb629ac-85da-4392-be7f-807e31063f20"><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="agsXMPP.dll" size="507904"><range /></file><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="form"><field type="list-single" var="stream-method"><option><value>http://jabber.org/protocol/bytestreams</value></option></field></x></feature></si></iq>
RECV: <iq xmlns="jabber:client" from="00_90000238@218.*.*.*/3a547429" to="228@218.*.*.*/254689f6" type="result" id="agsXMPP_9"><si xmlns="http://jabber.org/protocol/si" id="2bb629ac-85da-4392-be7f-807e31063f20"><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="submit"><field var="stream-method"><value>http://jabber.org/protocol/bytestreams</value></field></x></feature></si></iq>
SEND: <iq id="agsXMPP_10" to="00_90000238@218.*.*.*/3a547429" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="2bb629ac-85da-4392-be7f-807e31063f20" mode="tcp"><streamhost jid="228@218.*.*.*/254689f6" host="192.168.0.228" port="1000" /><streamhost jid="proxy.boyu.cc" host="proxy.boyu.cc" port="7777" /></query></iq>
RECV: <iq xmlns="jabber:client" from="00_90000238@218.*.*.*/3a547429" to="228@218.*.*.*/254689f6" type="result" id="agsXMPP_10"><query xmlns="http://jabber.org/protocol/bytestreams"><streamhost-used jid="proxy.boyu.cc" /></query></iq>
SEND: <iq id="agsXMPP_11" to="proxy.boyu.cc" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="2bb629ac-85da-4392-be7f-807e31063f20"><activate>00_90000238@218.*.*.*/3a547429</activate></query></iq>
RECV: <iq xmlns="jabber:client" from="proxy.boyu.cc" to="228@218.*.*.*/254689f6" type="error" id="agsXMPP_11"><query xmlns="http://jabber.org/protocol/bytestreams" sid="2bb629ac-85da-4392-be7f-807e31063f20"><activate>00_90000238@218.*.*.*/3a547429</activate></query><error code="404" type="cancel"><remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>


I think it is  configure your Openfire server  wrong.What should I do?
This post was edited on 2013-03-06, 19:11 by Alex.
Avatar
Alex #7
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by rose5178:
I use the "proxy.jabber.org" as PROXY ,and two client can transfer files. But use my openfire's proxy is an error as fallow:

I don't see proxy.jabber.org anywhere in your logs. And I don't think proxy.jabber.org is working anymore after the lastest server update on jabber.org.

Quote by rose5178:
RECV: <iq xmlns="jabber:client" from="proxy.boyu.cc" to="228@218.*.*.*/254689f6" type="error" id="agsXMPP_11"><query xmlns="http://jabber.org/protocol/bytestreams" sid="2bb629ac-85da-4392-be7f-807e31063f20"><activate>00_90000238@218.*.*.*/3a547429</activate></query><error code="404" type="cancel"><remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>

This is a server to server error. Either your server is configured wrong, not federated or the proxies you use are not pubic

Quote by rose5178:
I think it is  configure your Openfire server  wrong.What should I do?
What do you mean with "your Openfire Server"?

Alex
This post was edited on 2013-03-06, 19:11 by Alex.
Avatar
rose5178 #8
Member since Mar 2008 · 14 posts
Group memberships: Members
Show profile · Link to this post
1. I use the "proxy.jabber.org" as PROXY:

SEND: <iq id="agsXMPP_10" to="00_90000238@218.*.*.*/122f542c" type="set"><si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer" id="8ab6d266-235c-4309-933e-60494839594f"><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="application.xml" size="114"><range /></file><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="form"><field type="list-single" var="stream-method"><option><value>http://jabber.org/protocol/bytestreams</value></option></field></x></feature></si></iq>

RECV: <iq xmlns="jabber:client" from="00_90000238@218.*.*.*/122f542c" to="228@218.*.*.*/f279796d" type="result" id="agsXMPP_10"><si xmlns="http://jabber.org/protocol/si" id="8ab6d266-235c-4309-933e-60494839594f"><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="submit"><field var="stream-method"><value>http://jabber.org/protocol/bytestreams</value></field></x></feature></si></iq>

SEND: <iq id="agsXMPP_11" to="00_90000238@218.*.*.*/122f542c" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="8ab6d266-235c-4309-933e-60494839594f" mode="tcp"><streamhost jid="228@218.*.*.*/f279796d" host="192.168.0.228" port="1000" /><streamhost jid="proxy.jabber.org" host="proxy.jabber.org" port="7777" /></query></iq>

RECV: <iq xmlns="jabber:client" from="00_90000238@218.*.*.*/122f542c" to="228@218.*.*.*/f279796d" type="result" id="agsXMPP_11"><query xmlns="http://jabber.org/protocol/bytestreams"><streamhost-used jid="proxy.jabber.org" /></query></iq>

SEND: <iq id="agsXMPP_12" to="proxy.jabber.org" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="8ab6d266-235c-4309-933e-60494839594f"><activate>00_90000238@218.*.*.*/122f542c</activate></query></iq>

RECV: <iq xmlns="jabber:client" from="proxy.jabber.org" to="228@218.*.*.*/f279796d" type="result" id="agsXMPP_12"><query xmlns="http://jabber.org/protocol/bytestreams" sid="8ab6d266-235c-4309-933e-60494839594f" /></iq>

2.  The port 5269,7777 are open and forwarded firewall.what should I configure my Openfire server  except defualt configure?

It is successful to telnet  proxy.boyu.cc (my openfire's socks 5 proxy)   the port 5269,7777   .
This post was edited 3 times, last on 2013-03-06, 19:11 by Alex.
Avatar
rose5178 #9
Member since Mar 2008 · 14 posts
Group memberships: Members
Show profile · Link to this post
use my openfire's proxy is an error as follow(openfire logs):

2008.04.30 13:30:37 [org.jivesoftware.openfire.filetransfer.proxy.ProxyConnectionManager$1$1.run(ProxyConnectionManager.java:115)
] Error processing file transfer proxy connection
java.io.IOException: Illegal proxy transfer
at org.jivesoftware.openfire.filetransfer.proxy.ProxyConnectionManager.processConnection(ProxyConnectionManager.java:192)
at org.jivesoftware.openfire.filetransfer.proxy.ProxyConnectionManager.access$100(ProxyConnectionManager.java:44)
at org.jivesoftware.openfire.filetransfer.proxy.ProxyConnectionManager$1$1.run(ProxyConnectionManager.java:112)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Avatar
Alex #10
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
As I said before:
  • your jabber server server is configured wrong. Its still using IP addresses and not domains. With this configuration you will not be able to talk to a federated proxy like proxy.jabber.org
  • I don't know if proxy.jabber.org is functional. Please install your own proxy or find a public one in the internet which works. Test the proxy with 2 existing clients like Psi or Exodus.

Alex
Avatar
jbhops #11
Member since May 2008 · 1 post · Location: san diego california
Group memberships: Members
Show profile · Link to this post
I ran into the same problem with the mini client & proxy settings.  It took me awhile to find the bug in this...  The proxy name is hardcoded in the frmFileTransfer.cs file to be proxy.netlab.cz.  I fixed this by adding a textbox to allow the proxy and port number to be supplied.  Still didn't quite work.  I was able to send a file from a spark client to an ags mini client using an openfire server but not the reverse.  When using the spark client to mini client the spark client preferred a direct connection from client to client so I knew to look into the socket connections.  The problem occurs when the initiator of the transfer calls SendStreamHostResult.  The _p2pSocks5Socket.Address uses the proxy name directly from the text box which is not what I desired because the proxy for openfire is proxy.hostname and that certainly won't resolve in a DNS call.  So I added a method to substring the 'proxy' string off and voila the file transfers work using openfire as a media proxy / file transfer proxy.

So i recommend that you run one of the mini clients in the debugger and set a break point in SendStreamHostsResult and see what happens in the if statements.  I think you'll find that it is trying to use the incorrect proxy name.

Cheers,

Jeff
Avatar
Alex #12
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by jbhops:
... because the proxy for openfire is proxy.hostname and that certainly won't resolve in a DNS call.

if it does not resolve then the server or dns setup is broke. With a correct server setup this must resolve.

Many of the existing clients which implement SOCKS5 file transfer are not compatible to each other because some of them don't implement the XEP correct. We tested our code with Exodus, Psi and Tkabber and had no problems to transfer files in both directions. Spark seems to have problems with several other clients, so I would not use Spark as a reference implementation.

The file transfer code in MiniClient was not written for production. Is only some example code and not free from bugs.

Alex
Avatar
rose5178 #13
Member since Mar 2008 · 14 posts
Group memberships: Members
Show profile · Link to this post
I know how can transfer file between miniclient and spark.
You change code like this:

 private void SendStreamHosts()
        {
            ByteStreamIq bsIq = new ByteStreamIq();
            bsIq.To = m_To;
            bsIq.Type = IqType.set;

            bsIq.Query.Sid = m_Sid;
           
            string hostname = System.Net.Dns.GetHostName();         

            System.Net.IPHostEntry iphe = System.Net.Dns.Resolve(hostname);

            for (int i = 0; i < iphe.AddressList.Length; i++)
            {
                Console.WriteLine("IP address: {0}", iphe.AddressList[i].ToString());
               
                bsIq.Query.AddStreamHost(m_XmppCon.MyJID, iphe.AddressList[i].ToString(),7777);           }
          
            bsIq.Query.AddStreamHost(new Jid(PROXY), PROXY, 7777);
           
            _p2pSocks5Socket = new JEP65Socket();
            _p2pSocks5Socket.Initiator = m_XmppCon.MyJID;
            _p2pSocks5Socket.Target = m_To;
            _p2pSocks5Socket.SID = m_Sid;
            _p2pSocks5Socket.OnConnect += new ObjectHandler(_socket_OnConnect);
            _p2pSocks5Socket.OnDisconnect += new ObjectHandler(_socket_OnDisconnect);
            _p2pSocks5Socket.Listen(7777);


            m_XmppCon.IqGrabber.SendIq(bsIq, new IqCB(SendStreamHostsResult), null);
        }


And send file 's client is not on the same computer of the openfire.
This post was edited 2 times, last on 2008-05-03, 04:11 by rose5178.
Avatar
rose5178 #14
Member since Mar 2008 · 14 posts
Group memberships: Members
Show profile · Link to this post
My server uses domain like Email. The problem is solved.Thanks,Alex!!!!Thanks,everyone!!!
Avatar
Alex #15
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
in the original code:

  1. for (int i = 0; i < iphe.AddressList.Length; i++)
  2. {
  3.    Console.WriteLine("IP address: {0}", iphe.AddressList[i].ToString());
  4.    //bsIq.Query.AddStreamHost(m_XmppCon.MyJID, iphe.AddressList[i].ToString(), 1000);
  5. }

there is one line commented out. I should add an comment here or uncomment it. We commented it out for testing over SOCKS5 proxies.
This for each loops all your own internal Ip addresses and adds them as streamhosts. Because this IP addesses are internal IP addresses they will work only for internal fie transfers. This means both clients must be in the same LAN. It does not work over the internet.
Because most people want to transfer files over the Internet, and nearly all machines are behind NATs and Routers today this is commented out. I will add an comment for the next release there and uncomment it.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page:  1  2  next
Forum: agsXMPP RSS