xmppo / node-xmpp-bosh

An XMPP BOSH & WebSocket server (connection manager) written on node.js using Javascript
https://github.com/xmppo/node-xmpp-bosh
263 stars 85 forks source link

<stream:stream> root elements closed #14

Closed astro closed 12 years ago

astro commented 12 years ago

node-xmpp-bosh parses and sends only <stream:stream> elements that are closed.

Jack Moffitt's draft however specifies:

The stream tag MUST NOT be closed (i.e. the closing </stream:stream> tag should not appear in the message) as it is the start of the client's outgoing XML.

You may need to apply some weird string magic if you insist on DOM parsing.

dhruvbird commented 12 years ago

You are right - we've moved to SAX based parsing for BOSH - need to do the same for websocket as well.

dhruvbird commented 12 years ago

@astro Does this commit https://github.com/dhruvbird/node-xmpp-bosh/commit/7b7ccfe27aec1b8f4255d1c51ada7fd5af4431de solve your problem? I haven't been able to test with a client that doesn't close the stream:stream tag since I am testing using superfeedr's strophejs mod.

astro commented 12 years ago

Awesome response time. I will give a try!

astro commented 12 years ago

It now accepts a non-closed <stream:stream> from my client. In response to that however node-xmpp-bosh itself sends:

<stream:stream xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0" xml:lang="en" from="example.com"/>
dhruvbird commented 12 years ago

Let me know if current head works now.

astro commented 12 years ago

Perfect! Thank you very much.