'只有SOCKS5支持'OpenFire错误与XMPP文件传输

时间:2012-06-12 15:41:21

标签: proxy xmpp openfire socks xmppframework

我的问题:我正在使用XMPPFramework和OpenFire通过iOS上的XMPP进行文件传输。我的代码基础来自以下tutorial。目标似乎接受代理作为流主机,但当请求者尝试执行相同操作时,OpenFire会报告以下错误。为什么失败了,我该如何解决?

OpenFire错误 -

2012.06.12 14:38:40 org.jivesoftware.openfire.filetransfer.proxy.ProxyConnectionManager - Error processing file transfer proxy connection 
java.io.IOException: Only SOCKS5 supported 
at org.jivesoftware.openfire.filetransfer.proxy.ProxyConnectionManager.processConnection(ProxyConnectionManager.java:158) 
at org.jivesoftware.openfire.filetransfer.proxy.ProxyConnectionManager.access$200(ProxyConnectionManager.java:57) 
at org.jivesoftware.openfire.filetransfer.proxy.ProxyConnectionManager$1$1.run(ProxyConnectionManager.java:127) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) 
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
at java.lang.Thread.run(Thread.java:662)  

我的OpenFire XMPP设置 - (请注意我在这里设置了代理的外部IP)

xmpp.auth.anonymous - true
xmpp.client.compression.policy - disabled
xmpp.client.idle - -1
xmpp.client.idle.ping - false
xmpp.domain - beta.myCompany.co.uk
xmpp.enabled - true
xmpp.filetransfer.enabled - true
xmpp.offline.quota - 102400
xmpp.offline.type - bounce
xmpp.proxy.enabled - true
xmpp.proxy.externalip - 10.95.xxx.xxx (this is the ip of my server)
xmpp.proxy.port - 7777
xmpp.proxy.transfer.required - false
xmpp.server.compression.policy - disabled
xmpp.server.dialback.enabled - false
xmpp.server.socket.active - true
xmpp.session.conflict-limit - 0
xmpp.session.conflict.limit - 0
xmpp.socket.ssl.active - true

日志 -

2012-06-12 16:26:20.848 JabberClient[2711:207] RECIEVED IN APP DELEGATE - <iq xmlns="jabber:client" type="result" to="myUsername@beta.myCompany.co.uk/3a62c56a" id="4FC4CE04-DA8E-4CC2-B412-40D1C346F682" from="friendsUsername@beta.myCompany.co.uk/ee69d0fa"><si xmlns="http://jabber.org/protocol/si"><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>
2012-06-12 16:26:20.849 JabberClient[2711:207] Attempting XEP65 connection to friendsUsername@beta.myCompany.co.uk/ee69d0fa
2012-06-12 16:26:20.849 JabberClient[2711:207] TURNSocket DELEGATE STARTING
2012-06-12 16:26:20.851 JabberClient[2711:6103] SENT - <iq type="get" to="beta.myCompany.co.uk" id="C8A201C4-EC3B-49CC-8BF4-9604B872EB19"><query xmlns="http://jabber.org/protocol/disco#items"/></iq>
2012-06-12 16:26:20.856 JabberClient[2711:1e03] RECIEVED IN TURN SOCKET - <iq xmlns="jabber:client" type="result" id="C8A201C4-EC3B-49CC-8BF4-9604B872EB19" from="beta.myCompany.co.uk" to="myUsername@beta.myCompany.co.uk/3a62c56a"><query xmlns="http://jabber.org/protocol/disco#items"><item jid="pubsub.beta.myCompany.co.uk" name="Publish-Subscribe service"/><item jid="broadcast.beta.myCompany.co.uk" name="Broadcast service"/><item jid="search.beta.myCompany.co.uk" name="User Search"/><item jid="conference.beta.myCompany.co.uk" name="Public Chatrooms"/><item jid="proxy.beta.myCompany.co.uk" name="Socks 5 Bytestreams Proxy"/></query></iq>
2012-06-12 16:26:20.857 JabberClient[2711:1e03] SENT - <iq type="get" to="proxy.beta.myCompany.co.uk" id="92BF3339-987C-4A1E-8657-D8AE666DDC32"><query xmlns="http://jabber.org/protocol/disco#info"/></iq>
2012-06-12 16:26:20.857 JabberClient[2711:207] RECIEVED IN APP DELEGATE - <iq xmlns="jabber:client" type="result" id="C8A201C4-EC3B-49CC-8BF4-9604B872EB19" from="beta.myCompany.co.uk" to="myUsername@beta.myCompany.co.uk/3a62c56a"><query xmlns="http://jabber.org/protocol/disco#items"><item jid="pubsub.beta.myCompany.co.uk" name="Publish-Subscribe service"></item><item jid="broadcast.beta.myCompany.co.uk" name="Broadcast service"></item><item jid="search.beta.myCompany.co.uk" name="User Search"></item><item jid="conference.beta.myCompany.co.uk" name="Public Chatrooms"></item><item jid="proxy.beta.myCompany.co.uk" name="Socks 5 Bytestreams Proxy"></item></query></iq>
2012-06-12 16:26:20.862 JabberClient[2711:6103] RECIEVED IN TURN SOCKET - <iq xmlns="jabber:client" type="result" id="92BF3339-987C-4A1E-8657-D8AE666DDC32" from="proxy.beta.myCompany.co.uk" to="myUsername@beta.myCompany.co.uk/3a62c56a"><query xmlns="http://jabber.org/protocol/disco#info"><identity category="proxy" name="SOCKS5 Bytestreams Service" type="bytestreams"/><feature var="http://jabber.org/protocol/bytestreams"/><feature var="http://jabber.org/protocol/disco#info"/></query></iq>
2012-06-12 16:26:20.863 JabberClient[2711:6103] SENT - <iq type="get" to="proxy.beta.myCompany.co.uk" id="D13DE459-63EA-4CD6-97ED-8565559DF298"><query xmlns="http://jabber.org/protocol/bytestreams"/></iq>
2012-06-12 16:26:20.863 JabberClient[2711:207] RECIEVED IN APP DELEGATE - <iq xmlns="jabber:client" type="result" id="92BF3339-987C-4A1E-8657-D8AE666DDC32" from="proxy.beta.myCompany.co.uk" to="myUsername@beta.myCompany.co.uk/3a62c56a"><query xmlns="http://jabber.org/protocol/disco#info"><identity category="proxy" name="SOCKS5 Bytestreams Service" type="bytestreams"></identity><feature var="http://jabber.org/protocol/bytestreams"></feature><feature var="http://jabber.org/protocol/disco#info"></feature></query></iq>
2012-06-12 16:26:20.874 JabberClient[2711:6103] RECIEVED IN TURNSOCKET - <iq xmlns="jabber:client" type="result" id="D13DE459-63EA-4CD6-97ED-8565559DF298" from="proxy.beta.myCompany.co.uk" to="myUsername@beta.myCompany.co.uk/3a62c56a"><query xmlns="http://jabber.org/protocol/bytestreams"><streamhost jid="proxy.beta.myCompany.co.uk" host="10.95.xxx.xxx" port="7777"/></query></iq>
2012-06-12 16:26:20.875 JabberClient[2711:6103] SENT - <iq type="set" from="myUsername@beta.myCompany.co.uk/3a62c56a" to="friendsUsername@beta.myCompany.co.uk/ee69d0fa" id="4FC4CE04-DA8E-4CC2-B412-40D1C346F682"><query xmlns="http://jabber.org/protocol/bytestreams" sid="4FC4CE04-DA8E-4CC2-B412-40D1C346F682" mode="tcp"><streamhost xmlns="http://jabber.org/protocol/bytestreams" jid="proxy.beta.myCompany.co.uk" host="10.95.xxx.xxx" port="7777"/></query></iq>
2012-06-12 16:26:20.875 JabberClient[2711:207] RECIEVED IN APP DELEGATE - <iq xmlns="jabber:client" type="result" id="D13DE459-63EA-4CD6-97ED-8565559DF298" from="proxy.beta.myCompany.co.uk" to="myUsername@beta.myCompany.co.uk/3a62c56a"><query xmlns="http://jabber.org/protocol/bytestreams"></query></iq>
2012-06-12 16:26:20.916 JabberClient[2711:1e03] RECIEVED IN TURN SOCKET - <iq xmlns="jabber:client" type="result" to="myUsername@beta.myCompany.co.uk/3a62c56a" id="4FC4CE04-DA8E-4CC2-B412-40D1C346F682" from="friendsUsername@beta.myCompany.co.uk/ee69d0fa"><query xmlns="http://jabber.org/protocol/bytestreams" sid="4FC4CE04-DA8E-4CC2-B412-40D1C346F682"><streamhost-used jid="proxy.beta.myCompany.co.uk"/></query></iq>
2012-06-12 16:26:20.917 JabberClient[2711:1e03] TURNSocket: initiatorConnect: proxy.beta.myCompany.co.uk(10.95.xxx.xxx:7777)

1 个答案:

答案 0 :(得分:2)

我们来看看Openfire的源代码。这很简单,因为它是一个开源项目。 :)

ProxyConnectionManager.java:158告诉我们Openfire期望通过流发送第一个字节“5”(即SOCKS5连接),否则您看到的Exception将被抛出。根据{{​​3}},这似乎是正确的。

因此,如果不深入挖掘并对iOS上的XMPP有任何了解,我猜想在iOS上的xmppframework中有一些不正确的实现。我希望我能指出你正确的方向。