Yah, that’‘s what I thought as well, but here’‘s what’'s happening. (this is for Jig, an IRC gateway for using and IRC client with Jabber).
Here is my connect methodology:
161 out.println(“NOTICE jabberUser :Connecting to jabber…”);
162 // Log some information.
163
164 logIt("**** JabberID
: " + jabberID);
165 logIt("**** Username
: " + userName);
166 logIt("**** Nickname
: " + nickName);
167 logIt("**** Password
: " + passWord);
168 logIt("**** JabberHost --: " + jabberHost);
169 logIt("**** Socket
: " + incoming);
170
171 // Okay, connect to jabber…
172
173 // Create a connection to the jabber.org server.
174 try {
175 conn = new XMPPConnection(jabberHost);
176 conn.login(userName,passWord);
177 }
after connecting, I send a message:
239 logIt("**** PRIVMSG to " + target + " : " + msg);
240 try {
241 Chat newChat = conn.createChat(target);
242 Message newMessage = newChat.createMessage();
243 newMessage.setBody(msg);
244 newChat.sendMessage(newMessage);
245 }
In my output logs, I’'m seeing:
**** JabberID
: shayde@jabber.stonekeep.com
**** Username
: shayde
**** Nickname
: shevett
**** Password
: xxxxxxxx
**** JabberHost --: naboo.stonekeep.com
**** Socket
: Socket[addr=/10.0.0.11,port=3896,localport=8189]
**** PRIVMSG to dbs@jabber.stonekeep.com : Yo dude.
However, in my client (Exodus), the message appears as coming from ‘‘shayde@naboo.stonekeep.com/Smack’’
Further tidbits…
In Exodus, I can connect to my local server as "dbs@jabber.stonekeep.com", but there is a secondary tab that says “Connection” where I can specify a host to connect to. That -does- log me in correctly, showing up as ‘‘dbs@jabber.stonekeep.com’’ even though I’'m locally connected to ‘‘naboo.stonekeep.com’’.
One last bit.
I removed my shayde.xml file(s) from my Jabber spool directories, and re-created the account using Exodus. My shayde.xml file shows up spiffy.
Now when I connect from Smack, I’'m getting:
**** JabberID
: shayde@jabber.stonekeep.com
**** Username
: shayde
**** Nickname
: shevett
**** Password
: abc123
**** JabberHost --: naboo.stonekeep.com
**** Socket
: Socket[addr=/10.0.0.11,port=3945,localport=8189]
**** Exception thrown by XMPPConnection…
username: shayde
password: xxxxxx
hostname: naboo.stonekeep.com
(401) Unauthorized – org.jivesoftware.smack.XMPPException
at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:275)
at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:231)
at IRCThread.run(IRCThread.java:176)
because I’‘m assuming the account I’'m trying to authenticate against is being set up by smack as ‘‘shayde@naboo.stonekeep.com’’, not ‘‘shayde@jabber.stonekeep.com’’.
A proxy would fix this, since i woulnd’‘t have to socket directly via my local name to the server - Exodus and toher clients support (I’'m going assume) using an SSL proxy to connect through to a Jabber host.
Does that make sense? Feel free to poke me at JID dbs@jabber.stonekeep.com for more info.