I am trying to connect to node.js websocket using unitt ios client. But it is failing continuously may be because I'm using a different client. Which is the websocket version used in node.js?
-
Node.JS does not have native websockets, so it means you are using a module or have your own, or maybe you are using something that isn't websockets. And technically you should ask the author for the version, Please provide more information, we are not Sherlock holmes. Cheers – Farid Nouri Neshat Feb 04 '12 at 11:37
-
1Well you should be using it's own client, since they have built their own protocol on top different transports. Plain web-sockets, can't communicate with a socket.io server. – Farid Nouri Neshat Feb 06 '12 at 05:35
4 Answers
I've just updated my websocket library to be backwards compatible with hixie-76, which is used by iPhone / iPad / Safari / Opera.
See if that helps: https://github.com/einaros/ws

- 641
- 3
- 8
-
+1 for this implementation. I am using it successfully with both FF and Chrome, not saying it has binary transfer support – rezoner Feb 04 '12 at 18:48
-
It has full binary support for the hybi protocols. For hixie (in use by Chrome version 6 or earlier, FireFox 4 or earlier, Opera and Safari), true binary is not yet possible. – einaros Feb 05 '12 at 10:42
I have had luck with CocoaAsyncSocket. You can find the GitHub project here.
https://github.com/robbiehanson/CocoaAsyncSocket
Node.js can be used with Socket.io in which CocoaAsyncSockey can connect to.

- 4,580
- 3
- 22
- 30
I suggest updating your stack to use the iOS WebSocket library we just released. It's called SocketRocket. Caveat: it's still beta and untested in production.
It conforms to RFC 6455 which is the latest (and final) WebSocket standard. The Unitt client does not and is on an old standard which may be part of your issues you're having.
It also does not depend on CocoaAsyncSocket (or any other external dependencies). For me, this is a huge win because there are about half the number of places you can have bugs.
Very fast as well. A benchmark has shown it to perform better than a C++ (ASIO) WebSocket client.

- 1
- 1

- 5,682
- 3
- 31
- 36
-
Is there anything similar to https://github.com/pkyeck/socket.IO-objc but built off of SocketRocket? – Stephen Handley Mar 23 '12 at 22:44
I got it. I got a working socket.io client for IOS. You can download it from here http://minus.com/mbataWf5It#1 . I got this link from a youtube video http://www.youtube.com/watch?v=VCXKMVENW_o

- 871
- 8
- 18