Added an AnonClient object, based on the Client object, that allows conne #27

wants to merge 1 commit into


None yet
3 participants

jsumners commented Jul 8, 2011

Added an AnonClient object, based on the Client object, that allows connecting anonymously to servers that also support other mechanisms (e.g. PLAIN).

Added an AnonClient object, based on the Client object, that allows c…
…onnecting anonymously to servers that also support other mechanisms (e.g. PLAIN).

astro commented Jul 12, 2011

That sounds awesome. It does however duplicate some existing code.

Otherwise, sorry for the delay, I was on holiday. I'll look into it soon. Just tell me if you need it on npm urgently.

It does duplicate some existing code. I guess this pull is more of a working example of what I needed. In essence, all I did was force the sasl.mechanism to be 'ANONYMOUS' and remove some, easily removable, unnecessary code for that situation.

I do not need it urgently. I'm using the branch I created.


astro commented Sep 15, 2011

I just revisited the existing functionality.

The ANONYMOUS mechanism is chosen if advertised by the server, but with least priority. Please check if that is the case for you and it is going to work fine.

@astro astro closed this Sep 15, 2011

The existing functionality does not work for me specifically because of the lower priority. I am using node-xmpp for a bot that does not have an account on the chat server. With the lower priority, when the bot tries to connect anonymously it gets rejected because node-xmpp tells the server that it is capable of sending a username and password. Thus, the server expects a username and and password from node-xmpp. Therefore, I need to specify the anonymous mechanism.

xlight commented Mar 2, 2012

“need to specify the anonymous mechanism” +1


astro commented Mar 2, 2012

Oops, I overlooked the last comments here.

I have never encountered an XMPP domain that allows both mechanisms. Do you have a patch or at least a test server ready? How would you like this option to be named? preferredSaslMechanism?

jsumners commented Mar 2, 2012

My bot is still running on node.js 0.4 with my patched node-xmpp. I haven't had time to patch both the bot (the sys package changed) and node-xmpp. I might be able to get to it next week and submit a new patch, but I wouldn't count on it.

The server I'm connecting to is a Openfire server ( The reasoning behind authenticated and anonymous at the same time is a result of the Fastpath plugin ( This lets "support agents" login to the server, while "web clients" can simply chat with the support agents. However, I can't provide access to the server for testing, because it isn't a public thing yet.

A simple property, like preferredSaslMechanism, would be excellent.

astro added a commit that referenced this pull request Mar 3, 2012

client, sasl: preferredSaslMechanism
Should fix the aftermath of Github issue #27

astro commented Mar 3, 2012

Released node-xmpp 0.3.2 with that.

xlight commented Mar 3, 2012


jsumners commented Mar 3, 2012

Excellent. I'll incorporate it this coming Monday.

jsumners commented Mar 6, 2012

Thank you. This works great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment