[jdev] net::jabber connect w/ srv dns

Gabriel Millerd gmillerd at gmail.com
Thu Jul 13 05:15:11 CDT 2006


>
> You will need to do the SRV lookups yourself in order to hand Net::Jabber
> a hostname, either via Net::DNS (requiring you to know how SRV records
> work), or Net::RULI (interface to extra library, but hands you the results
> on a platter).
>
   Thanks for replying.

   I can resolve the actual _xmpp-client._tcp myself (worse case I
could statically code it). But it seems that I am still left with
'hostname,port,username,passwd,resource' for my options. And username
automatically becomes username at hostname. I cannot supply a realm or it
wont auth.

$jc->Connect(hostname=>"chatserver.com", port=>5222);
$jc->AuthSend(username=>"mybot", password=>"***", resource=>"perl");

this will express itself as 'mybot at chatserver.com' to
chatserver.com:5222. The issue is that chatserver.com doesnt have a
jabber service. It actually is running on actual.chatserver.com.
Expressing this like ...

$jc->Connect(hostname=>"actual.chatserver.com", port=>5222);
$jc->AuthSend(username=>"mybot", password=>"***", resource=>"perl");

causes breakage. It likely is freaking out about
"mybot at chatserver.com@auctual.chatserver.com" for a JID

> I'd point at the ->resolve routine of Jabber::Lite (perl-only Jabber
> parser/whathaveyou), but thats just blatant self-promotion ;)
>
   I hear ya, I have been on cpan poking around. I first tried
loudmouth since it was on debian and easily obtained for me. Yours is
the most recent of anything. A few 'kick start' examples and I would
be there a while ago.

   In the meantime i am running a tcp proxy between
chatserver.com:5222 and actual.chatserver.com:5222. Of course this is
very temporary and doesnt allow for various security options that I
want to impliment.

   Thanks again

-- 
Gabriel Millerd



More information about the JDev mailing list