14
votes

I've been using socket.io to create a websocket enabled server in node.js, and its great. Now i'd like however, to create a server-side client in node.js which can connect to a websocket server elsewhere. Are there any libraries out there for this?

Thanks

3
This question duplicates: stackoverflow.com/questions/3842565/… See my extensive answer there. - colin moock

3 Answers

2
votes

Not any that are great.

I talked to Guillermo about this on mailing list a couple days ago, see http://groups.google.com/group/socket_io/browse_thread/thread/74e9ff6d7e931f6e

I wrote this as a bootstrap to help in my testing: https://github.com/jmoyers/mettle/blob/master/test/test-socket.coffee#L18-49

Guillermo is working on one here for 0.7: https://github.com/LearnBoost/Socket.IO-node-client

1
votes

I've just been working on a project with similar needs: a Node server that acts as a Socket.io server and connects to another service via proper websockets. I used the ws module for the websocket client in Node.

Do be aware that, as noted above by Josh, Socket.io is a protocol on top of web sockets.