hellozedan / node-xmpp-bosh

Automatically exported from code.google.com/p/node-xmpp-bosh
0 stars 0 forks source link

WebSocket error with Safari #37

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Safari (and Safari iOS) throw an error "Unexpected response code: 400" when I 
try to establish a connection with node-xmpp-bosh through WebSocket.
Can someone confirm that?

Step to reproduce:
Open Safari error console
Open http://websocket.org/echo.html
In the location field, enter your node-xmpp-bosh instance url
Click connect
Safari error console should throw an error

Original issue reported on code.google.com by sonny.pi...@gmail.com on 21 Dec 2011 at 3:14

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Alright, I took a look in node-xmpp-bosh source code and I realized there are 2 
websocket implementations using 2 different websocket libraries.
I switched and now it works in Safari.

I don't know when Apple will update Safari's WebSocket support, crossing 
fingers.

Original comment by sonny.pi...@gmail.com on 21 Dec 2011 at 5:42

GoogleCodeExporter commented 8 years ago
Yes, there is some confusion about which library to use. However, with 
WebSockets becoming an RFC now, things should stabilize in a few months.
Also, let us know if you hear of a module the implements WebSockets by the RFC.

Original comment by dhruvb...@gmail.com on 22 Dec 2011 at 6:30

GoogleCodeExporter commented 8 years ago
"Also, let us know if you hear of a module the implements WebSockets by the 
RFC."
https://github.com/Worlize/WebSocket-Node

For Safari support, I'm currently running two instances of node-xmpp-bosh on 
two different ports each of them use a different websocket library.
I'm going to use a client-side hack instead: 
https://github.com/gimite/web-socket-js/ After all, it's a client-side issue.

By the way; my XMPP over Websocket library: 
https://github.com/sonnyp/lightstring

Original comment by sonny.pi...@gmail.com on 15 Jan 2012 at 1:21

GoogleCodeExporter commented 8 years ago
Thanks for the info. on WebSocket-Node. We'll be keeping a watch on the 
progress and adoption of that library.

How does web-socket-js help. I wasn't quite able to see what it does to help 
with Safari.

Can I use your library on node.js? We need something for automated websockets 
tests. Currently we use a modified strophe.js for the BOSH layer.

Original comment by dhruvb...@gmail.com on 18 Jan 2012 at 3:09

GoogleCodeExporter commented 8 years ago
"How does web-socket-js help. I wasn't quite able to see what it does to help 
with Safari."
Well on Safari I force the use of web-socket-js Websocket object instead of the 
native one. Of course it won't works on Safari iOS since Flash isn't available 
on that platform.

"Can I use your library on node.js? We need something for automated websockets 
tests. Currently we use a modified strophe.js for the BOSH layer."
Sure! However it's not complete but I would really appreciate pull requests, 
suggestions or any kind of involvement.
Don't hesitate to mail me.

Original comment by sonny.pi...@gmail.com on 18 Jan 2012 at 1:28

GoogleCodeExporter commented 8 years ago
Hello,

This commit: 
https://github.com/dhruvbird/node-xmpp-bosh/commit/437eb69788fe8f7e578fe775fadc5
1d995b19c1c adds support for the latest WebSocket RFC. You should be able to 
use it out of the box now.

Original comment by dhruvb...@gmail.com on 23 Mar 2012 at 12:33

GoogleCodeExporter commented 8 years ago
Safari still don't support the latest WebSocket RFC, so the status of this 
issue shouldn't be fixed.

Original comment by sonny.pi...@gmail.com on 23 Mar 2012 at 12:30

GoogleCodeExporter commented 8 years ago

Original comment by dhruvb...@gmail.com on 23 Mar 2012 at 12:45