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
Using websocket-node To implement the WebSocket client on Node. js, you can use one of the many package libraries available. One of the simplest is 'websocket-node,' a pure JavaScript implementation of the WebSocket protocol for Node.
Client authentication import { createServer } from 'http'; import { WebSocketServer } from 'ws'; const server = createServer(); const wss = new WebSocketServer({ noServer: true }); wss. on('connection', function connection(ws, request, client) { ws. on('message', function message(data) { console.
What is WebSocket? Websocket is a simple to use, fast and tested WebSocket client and server implementation. The Websocket specification defines an API establishing a connection between a web browser and server. WebSocket is used for creating real-time games, chat applications, displaying stock data, etc.
WebSocket Connection. HTTP Connection. WebSocket is a bidirectional communication protocol that can send the data from the client to the server or from the server to the client by reusing the established connection channel.
https://github.com/pgriess/node-websocket-client <-- does this one work for you?
Found on this list here: https://github.com/joyent/node/wiki/modules
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With