-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for WebSocket version Hixie draft 76 #24
Comments
Last time I've checked, node-xmpp-bosh allowed to specify the websocket library to use so Hixie draft 76 was supported. The problem with this solution is that I had to run 2 node-xmpp-bosh instances. I'm working on adding support for Hixie draft 76 by using this WebSocket library https://github.com/einaros/ws . Would you be interested in such a patch? |
@sonnyp yep - sounds good! a patch would be welcome :) So, let me see if I understood this right - the library https://github.com/einaros/ws will (after your changes) support all revisions from draft 76 through the current RFC? |
@sonnyp I just saw the project page, and it seems that https://github.com/einaros/ws already supports draft76? |
When I said "I'm working on adding support for Hixie draft 76", I meant on node-xmpp-bosh, not on ws, which, as you said, already support it (which is why I would like to use it for node-xmpp-bosh). |
Ah! I had misunderstood you earlier! Sounds good! I think we can modify the default websocket.js to use this new websocket library rather than websocket-node since it supports more versions of the protocol and the benchmarks seem to suggest that it is equally performant. |
Do you see any value in supporting both websocket libraries? I did that in the past and it was slightly painful, without much benefit. I assumed that the community would gravitate toward one websocket library eventually, but that hasn't happened yet (it seems). |
No I don't see any value in supporting both WebSocket libraries. |
@sonnyp Any reason why you think that websocket-node is the long-term solution? (just curious) |
Sorry, I shouldn't have used the word "switch", it wasn't appropriate for what I meant. |
ah! got you (y) |
https://github.com/sonnyp/node-xmpp-bosh/commit/6d42bf06d3a55c5a8f3115466a8b907c94886d77 It works, but it's probably still a work in progress, I would really appreciate your feedback on this. I took the liberty to strip trailing spaces, replace tabs by spaces and re-indent. Please tell me if you prefer me to do that in a separated commit and/or if you don't want those changes. |
This is super! We prefer spaces instead of tabs. Yeah, a separate commit for the Do we accept anything in the subprotocol? I mean it's okay as long as I don't know what CORS issue could pop up with websockets. I've been Thanks! p.s. Also, could you add yourself to the list if contribs. in On Thu, Apr 5, 2012 at 9:32 AM, Sonny
-Dhruv Matani. "What's the simplest thing that could possibly work?" |
For the subprotocol concern, I thought Opera and Safari didn't support the subprotocol mechanism but apparently they do. I think we should refuse connection when the xmpp subprotocol isn't declared in the header, it might help avoid error for the client. Regarding CORS, I'm more worried about security, but I'm note sure why :-) I will address your comment on formatting stuff. I've just tested and I can confirm xmpp-bosh WebSocket transport is now fully functional with Opera, Safari and Safari iOS. \o/ |
@sonnyp Yes, if both the client and the ws package support it, we should allow it. w.r.t CORS, I am not sure if it is applicable here since we connect to a ws:// URL and not an http:// URL. Of course, I am not at all sure about this and would be great if you could confirm that. Tested with Chrome as well. |
"Yes, if both the client and the ws package support it, we should allow it." "w.r.t CORS, I am not sure if it is applicable here since we connect to a ws:// URL and not an http:// URL. Of course, I am not at all sure about this and would be great if you could confirm that." |
w.r.t. subprotocol, I agree - only the xmpp subprotocol should be allowed given that all clients support this. Yes, even I see that it is the case, but the protocol negotiation seems to be currently working w/o the CORS headers. I wonder how? |
@sonnyp Send me a pull request once you are reasonably confident of the stability of your branch. |
I randomly have this error, need investigation: |
@sonnyp Do you still see such crashes or does it seem to have been fixed? |
Sorry haven't been around lately. |
sure! |
I couldn't reproduce the error. |
Great news - thanks for confirming! |
I'm looking at the subprotocol support within ws. |
The sub protocol handler was borken, I sent a pull request with a fix. |
+1 |
Follow up https://code.google.com/p/node-xmpp-bosh/issues/detail?id=37
http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76
Hixie draft 76 is old and deprecated, but still in use by Safari and Opera.
The text was updated successfully, but these errors were encountered: