Discussion:
Trouble connect()'ng to non-JID based server
Armando Di Cianno
2010-06-21 14:37:05 UTC
Permalink
I'm having some issues using the form of Client connect() where an
"alternative" (i.e. non-JID based server), and port are used.

$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]

$ gem list --remote |grep -i xmpp4r
xmpp4r (0.5)

Passing in server, when the JID matches seems to work (using jabber.org):

require 'rubygems'
require 'xmpp4r/client'
include Jabber
jid = JID::new('agoratest1-/eSpBmjxGS4dnm+***@public.gmane.org/ruby')
password = 'XXXXXXXXX'
cl = Client::new(jid)
cl.connect("jabber.org", 5222)
cl.auth(password)

While using an SSH-based proxy seems to fail (this server is also an
anonymous server):

require 'rubygems'
require 'xmpp4r/client'
include Jabber
Jabber::debug = true
jid = JID::new('anon2-***@public.gmane.org/ruby')
cl = Client::new(jid)
cl.connect("localhost", 5222)
cl.auth_anonymous

... and I get output like the following in debug mode:

D, [2010-06-21T10:29:47.325225 #18636] DEBUG -- : CONNECTING:
localhost:5222
D, [2010-06-21T10:29:47.326015 #18636] DEBUG -- : SENDING:
<stream:stream xmlns:stream='http://etherx.jabber.org/streams'
xmlns='jabber:client' to='my.xmpp.agoragames.com' xml:lang='en'
version='1.0' >
W, [2010-06-21T10:29:47.326314 #18636] WARN -- : EXCEPTION:
NoMethodError
undefined method `[]' for nil:NilClass
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:149:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in `new'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
`create_from'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:133:in
`stream='
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:110:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`parse'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:75:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:119:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:87:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:77:in
`connect'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:70:in
`connect'
(irb):7:in `irb_binding'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52:in
`irb_binding'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52
W, [2010-06-21T10:29:47.326403 #18636] WARN -- : Exception caught in
Parser thread! (NoMethodError)
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:149:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in `new'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
`create_from'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:133:in
`stream='
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:110:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`parse'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:75:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:119:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:87:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:77:in
`connect'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:70:in
`connect'
(irb):7:in `irb_binding'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52:in
`irb_binding'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52

... I also attempted to connect to my company's xmpp service (with
xmpp4r), which uses talk.google.com, and it fails similarly --
although, I've only managed to get it to connect to talk.google.com
from Emapthy on Ubuntu using old-SSL and port 5223 -- which I'm not
sure if xmpp4r supports any longer.

The SSH tunnel/proxy is creating thusly:

ssh -D 522 my.server.net -N

... which creates a SOCKS-type proxy. Could this be the issue?

I'm just getting started with xmpp4r, so if someone could eyeball a
real problem in the error output, or just let me know if I'm doin' it
wrong, that would be fantastic.

Thanks,
__Armando Di Cianno
Agora Games, Inc.
Erik Elmore
2010-06-21 14:44:47 UTC
Permalink
What do you mean by a non-JID based server?

+=
Erik Elmore




On Mon, Jun 21, 2010 at 10:37 AM, Armando Di Cianno <
Post by Armando Di Cianno
I'm having some issues using the form of Client connect() where an
"alternative" (i.e. non-JID based server), and port are used.
$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
$ gem list --remote |grep -i xmpp4r
xmpp4r (0.5)
require 'rubygems'
require 'xmpp4r/client'
include Jabber
password = 'XXXXXXXXX'
cl = Client::new(jid)
cl.connect("jabber.org", 5222)
cl.auth(password)
While using an SSH-based proxy seems to fail (this server is also an
require 'rubygems'
require 'xmpp4r/client'
include Jabber
Jabber::debug = true
cl = Client::new(jid)
cl.connect("localhost", 5222)
cl.auth_anonymous
localhost:5222
<stream:stream xmlns:stream='http://etherx.jabber.org/streams'
xmlns='jabber:client' to='my.xmpp.agoragames.com' xml:lang='en'
version='1.0' >
NoMethodError
undefined method `[]' for nil:NilClass
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:149:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in `new'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
`create_from'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:133:in
`stream='
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:110:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`parse'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:75:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:119:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:87:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:77:in
`connect'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:70:in
`connect'
(irb):7:in `irb_binding'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52:in
`irb_binding'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52
W, [2010-06-21T10:29:47.326403 #18636] WARN -- : Exception caught in
Parser thread! (NoMethodError)
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:149:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in `new'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
`create_from'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:133:in
`stream='
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:110:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`parse'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:75:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:119:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:87:in
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:77:in
`connect'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:70:in
`connect'
(irb):7:in `irb_binding'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52:in
`irb_binding'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52
... I also attempted to connect to my company's xmpp service (with
xmpp4r), which uses talk.google.com, and it fails similarly --
although, I've only managed to get it to connect to talk.google.com
from Emapthy on Ubuntu using old-SSL and port 5223 -- which I'm not
sure if xmpp4r supports any longer.
ssh -D 522 my.server.net -N
... which creates a SOCKS-type proxy. Could this be the issue?
I'm just getting started with xmpp4r, so if someone could eyeball a
real problem in the error output, or just let me know if I'm doin' it
wrong, that would be fantastic.
Thanks,
__Armando Di Cianno
Agora Games, Inc.
_______________________________________________
Xmpp4r-devel mailing list
https://mail.gna.org/listinfo/xmpp4r-devel
Armando Di Cianno
2010-06-21 14:58:24 UTC
Permalink
Post by Erik Elmore
What do you mean by a non-JID based server?
I'm probably using the wrong terminology. For example ...

'***@foo.com/desktop', as a JID, allows xmpp4r to resolve and connect
to foo.com (or DNS SRV magic that eventually resolves in the server to
connect to).

However, sometimes -- google apps being a solid example -- the JID has
nothing to do DNS-wise with the server to connect to. In the google
apps case, the JID bears the company name, and the connect server is
talk.google.com. In my case, I'd like to connect to localhost, as I
have an SSH-proxy setup (which works with pidgin, fwiw) that allows me
to connect to the real-server.

__Armando Di Cianno
Agora Games, Inc.
Post by Erik Elmore
What do you mean by a non-JID based server?
+=
Erik Elmore
On Mon, Jun 21, 2010 at 10:37 AM, Armando Di Cianno
Post by Armando Di Cianno
I'm having some issues using the form of Client connect() where an
"alternative" (i.e. non-JID based server), and port are used.
$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
$ gem list --remote |grep -i xmpp4r
xmpp4r (0.5)
require 'rubygems'
require 'xmpp4r/client'
include Jabber
password = 'XXXXXXXXX'
cl = Client::new(jid)
cl.connect("jabber.org", 5222)
cl.auth(password)
While using an SSH-based proxy seems to fail (this server is also an
require 'rubygems'
require 'xmpp4r/client'
include Jabber
Jabber::debug = true
cl = Client::new(jid)
cl.connect("localhost", 5222)
cl.auth_anonymous
   localhost:5222
   <stream:stream xmlns:stream='http://etherx.jabber.org/streams'
xmlns='jabber:client' to='my.xmpp.agoragames.com' xml:lang='en'
version='1.0' >
   NoMethodError
   undefined method `[]' for nil:NilClass
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:149:in
`initialize'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
`new'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
`create_from'
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:133:in
`stream='
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:110:in
`initialize'
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`new'
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`initialize'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`new'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`parse'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:75:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`initialize'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`new'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:119:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:87:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:77:in
`connect'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:70:in
`connect'
   (irb):7:in `irb_binding'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52:in
`irb_binding'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52
W, [2010-06-21T10:29:47.326403 #18636]  WARN -- : Exception caught in
Parser thread! (NoMethodError)
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:149:in
`initialize'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
`new'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
`create_from'
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:133:in
`stream='
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:110:in
`initialize'
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`new'
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`initialize'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`new'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`parse'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:75:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`initialize'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`new'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:119:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:87:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:77:in
`connect'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:70:in
`connect'
   (irb):7:in `irb_binding'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52:in
`irb_binding'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52
... I also attempted to connect to my company's xmpp service (with
xmpp4r), which uses talk.google.com, and it fails similarly --
although, I've only managed to get it to connect to talk.google.com
from Emapthy on Ubuntu using old-SSL and port 5223 -- which I'm not
sure if xmpp4r supports any longer.
 ssh -D 522 my.server.net -N
... which creates a SOCKS-type proxy.  Could this be the issue?
I'm just getting started with xmpp4r, so if someone could eyeball a
real problem in the error output, or just let me know if I'm doin' it
wrong, that would be fantastic.
Thanks,
__Armando Di Cianno
Agora Games, Inc.
_______________________________________________
Xmpp4r-devel mailing list
https://mail.gna.org/listinfo/xmpp4r-devel
_______________________________________________
Xmpp4r-devel mailing list
https://mail.gna.org/listinfo/xmpp4r-devel
Armando Di Cianno
2010-06-21 15:07:35 UTC
Permalink
All,

I've debugged my own issue.

The documentation about using connect() to connect to an alternative
server was correct. My failure related to the fact that I had been
using ssh to create a SOCKS5-type proxy -- and not a "pure" tunnel --
and xmpp4r doesn't speak SOCKS5.

SOCKS5 type:
ssh -D 5222 mydomain.net -N

"Pure" tunnel:
ssh mydomain.net -L 5222:the-internal-xmpp-hostname:5222 -N

The 2nd example allows xmpp4r to work transparently, whereas the
SOCKS5 one (somewhat obviously in hindsight) would take client-library
support.

Thanks,
__Armando Di Cianno
Agora Games, Inc.


On Mon, Jun 21, 2010 at 10:58 AM, Armando Di Cianno
Post by Armando Di Cianno
Post by Erik Elmore
What do you mean by a non-JID based server?
I'm probably using the wrong terminology. For example ...
to foo.com (or DNS SRV magic that eventually resolves in the server to
connect to).
However, sometimes -- google apps being a solid example -- the JID has
nothing to do DNS-wise with the server to connect to. In the google
apps case, the JID bears the company name, and the connect server is
talk.google.com. In my case, I'd like to connect to localhost, as I
have an SSH-proxy setup (which works with pidgin, fwiw) that allows me
to connect to the real-server.
__Armando Di Cianno
Agora Games, Inc.
Post by Erik Elmore
What do you mean by a non-JID based server?
+=
Erik Elmore
On Mon, Jun 21, 2010 at 10:37 AM, Armando Di Cianno
Post by Armando Di Cianno
I'm having some issues using the form of Client connect() where an
"alternative" (i.e. non-JID based server), and port are used.
$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
$ gem list --remote |grep -i xmpp4r
xmpp4r (0.5)
require 'rubygems'
require 'xmpp4r/client'
include Jabber
password = 'XXXXXXXXX'
cl = Client::new(jid)
cl.connect("jabber.org", 5222)
cl.auth(password)
While using an SSH-based proxy seems to fail (this server is also an
require 'rubygems'
require 'xmpp4r/client'
include Jabber
Jabber::debug = true
cl = Client::new(jid)
cl.connect("localhost", 5222)
cl.auth_anonymous
   localhost:5222
   <stream:stream xmlns:stream='http://etherx.jabber.org/streams'
xmlns='jabber:client' to='my.xmpp.agoragames.com' xml:lang='en'
version='1.0' >
   NoMethodError
   undefined method `[]' for nil:NilClass
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:149:in
`initialize'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
`new'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
`create_from'
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:133:in
`stream='
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:110:in
`initialize'
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`new'
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`initialize'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`new'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`parse'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:75:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`initialize'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`new'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:119:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:87:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:77:in
`connect'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:70:in
`connect'
   (irb):7:in `irb_binding'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52:in
`irb_binding'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52
W, [2010-06-21T10:29:47.326403 #18636]  WARN -- : Exception caught in
Parser thread! (NoMethodError)
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:149:in
`initialize'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
`new'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
`create_from'
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:133:in
`stream='
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:110:in
`initialize'
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`new'
 /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
`initialize'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`new'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
`parse'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:75:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`initialize'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`new'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:119:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:87:in
`start'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:77:in
`connect'
 /home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:70:in
`connect'
   (irb):7:in `irb_binding'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52:in
`irb_binding'
   /home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52
... I also attempted to connect to my company's xmpp service (with
xmpp4r), which uses talk.google.com, and it fails similarly --
although, I've only managed to get it to connect to talk.google.com
from Emapthy on Ubuntu using old-SSL and port 5223 -- which I'm not
sure if xmpp4r supports any longer.
 ssh -D 522 my.server.net -N
... which creates a SOCKS-type proxy.  Could this be the issue?
I'm just getting started with xmpp4r, so if someone could eyeball a
real problem in the error output, or just let me know if I'm doin' it
wrong, that would be fantastic.
Thanks,
__Armando Di Cianno
Agora Games, Inc.
_______________________________________________
Xmpp4r-devel mailing list
https://mail.gna.org/listinfo/xmpp4r-devel
_______________________________________________
Xmpp4r-devel mailing list
https://mail.gna.org/listinfo/xmpp4r-devel
Erik Elmore
2010-06-22 08:06:56 UTC
Permalink
I love it when a plan comes together.

+=
Erik Elmore




On Mon, Jun 21, 2010 at 11:07 AM, Armando Di Cianno <
Post by Armando Di Cianno
All,
I've debugged my own issue.
The documentation about using connect() to connect to an alternative
server was correct. My failure related to the fact that I had been
using ssh to create a SOCKS5-type proxy -- and not a "pure" tunnel --
and xmpp4r doesn't speak SOCKS5.
ssh -D 5222 mydomain.net -N
ssh mydomain.net -L 5222:the-internal-xmpp-hostname:5222 -N
The 2nd example allows xmpp4r to work transparently, whereas the
SOCKS5 one (somewhat obviously in hindsight) would take client-library
support.
Thanks,
__Armando Di Cianno
Agora Games, Inc.
On Mon, Jun 21, 2010 at 10:58 AM, Armando Di Cianno
Post by Armando Di Cianno
Post by Erik Elmore
What do you mean by a non-JID based server?
I'm probably using the wrong terminology. For example ...
to foo.com (or DNS SRV magic that eventually resolves in the server to
connect to).
However, sometimes -- google apps being a solid example -- the JID has
nothing to do DNS-wise with the server to connect to. In the google
apps case, the JID bears the company name, and the connect server is
talk.google.com. In my case, I'd like to connect to localhost, as I
have an SSH-proxy setup (which works with pidgin, fwiw) that allows me
to connect to the real-server.
__Armando Di Cianno
Agora Games, Inc.
Post by Erik Elmore
What do you mean by a non-JID based server?
+=
Erik Elmore
On Mon, Jun 21, 2010 at 10:37 AM, Armando Di Cianno
Post by Armando Di Cianno
I'm having some issues using the form of Client connect() where an
"alternative" (i.e. non-JID based server), and port are used.
$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
$ gem list --remote |grep -i xmpp4r
xmpp4r (0.5)
Passing in server, when the JID matches seems to work (using
require 'rubygems'
require 'xmpp4r/client'
include Jabber
password = 'XXXXXXXXX'
cl = Client::new(jid)
cl.connect("jabber.org", 5222)
cl.auth(password)
While using an SSH-based proxy seems to fail (this server is also an
require 'rubygems'
require 'xmpp4r/client'
include Jabber
Jabber::debug = true
cl = Client::new(jid)
cl.connect("localhost", 5222)
cl.auth_anonymous
localhost:5222
<stream:stream xmlns:stream='http://etherx.jabber.org/streams'
xmlns='jabber:client' to='my.xmpp.agoragames.com' xml:lang='en'
version='1.0' >
NoMethodError
undefined method `[]' for nil:NilClass
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:149:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`create_from'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:133:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`stream='
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:110:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`parse'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:75:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:119:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:87:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:77:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`connect'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:70:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`connect'
(irb):7:in `irb_binding'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`irb_binding'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52
W, [2010-06-21T10:29:47.326403 #18636] WARN -- : Exception caught in
Parser thread! (NoMethodError)
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:149:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/source.rb:16:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`create_from'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:133:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`stream='
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/baseparser.rb:110:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/rexml/parsers/sax2parser.rb:11:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:39:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`parse'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:75:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`initialize'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`new'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:72:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:119:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:87:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`start'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:77:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`connect'
/home/fafhrd/Projects/ruby/install/lib/ruby/gems/1.8/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:70:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`connect'
(irb):7:in `irb_binding'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52:in
Post by Armando Di Cianno
Post by Erik Elmore
Post by Armando Di Cianno
`irb_binding'
/home/fafhrd/Projects/ruby/install/lib/ruby/1.8/irb/workspace.rb:52
... I also attempted to connect to my company's xmpp service (with
xmpp4r), which uses talk.google.com, and it fails similarly --
although, I've only managed to get it to connect to talk.google.com
from Emapthy on Ubuntu using old-SSL and port 5223 -- which I'm not
sure if xmpp4r supports any longer.
ssh -D 522 my.server.net -N
... which creates a SOCKS-type proxy. Could this be the issue?
I'm just getting started with xmpp4r, so if someone could eyeball a
real problem in the error output, or just let me know if I'm doin' it
wrong, that would be fantastic.
Thanks,
__Armando Di Cianno
Agora Games, Inc.
_______________________________________________
Xmpp4r-devel mailing list
https://mail.gna.org/listinfo/xmpp4r-devel
_______________________________________________
Xmpp4r-devel mailing list
https://mail.gna.org/listinfo/xmpp4r-devel
_______________________________________________
Xmpp4r-devel mailing list
https://mail.gna.org/listinfo/xmpp4r-devel
Loading...