1

I've been running the echo.html example that comes with Strophe.js. When I start it up I sign in using a user I made called user1. When I click the connect button I get the following output:

Strophe is connecting.
Strophe is connected.
ECHOBOT: Send a message to 5ee09j8v8y@ubuntu/5ee09j8v8y to talk to me.

I am able to successfully test this example using the Gajim client. In Gajim I simply start a new chat using the above JID (5ee09j8v8y@ubuntu/5ee09j8v8y). When I send a message using Gajim it shows up on the echobot example and everything is hunky dory.

So here's my question, I see from this official site that the JID is in this format:

<JID> ::= [<node>"@"]<domain>["/"<resource>]

And I get that the resource is optional, and that the domain in my case above is simply my computer's name (my computer's name is ubuntu). BUT what I don't get is how the heck you get 5ee09j8v8y from the username user1.

The code inside echobot.js which prints the JID line above uses this command to get the information:

connection.jid

Which is just a Strophe.Connection Object retrieving it's JID.

So to sum all of this up, I cannot communicate from Gajim using user1@ubuntu/5ee09j8v8y the only way it works is when I use the JID 5ee09j8v8y@ubuntu/5ee09j8v8y. So what exactly is the node (5ee09j8v8y), how does it get mapped to the username (user1), how can I get Gajim to work with user1@ubuntu/5ee09j8v8y instead of using 5ee09j8v8y@ubuntu/5ee09j8v8y and at the very least can someone point me in the right direction to some documentation on this JID problem?

Note: This tutorial will explain my setup (and help others who are curious in how I set all of this up).

Community
  • 1
  • 1
Kyle Bridenstine
  • 6,055
  • 11
  • 62
  • 100
  • Check my previous answers on SO, maybe the examples could help you: http://stackoverflow.com/questions/34510219/chat-functionality-in-web-application-using-xmpp-and-openfire/34524981#34524981, http://stackoverflow.com/questions/34994662/strophe-register-plugin/35055565#35055565, http://stackoverflow.com/questions/35292181/complete-example-of-strophe-js-file-transfer/35358428#35358428 – beaver Mar 24 '16 at 13:23

0 Answers0