Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a server-side Websocket client for node.js?

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

like image 609
noli Avatar asked May 20 '11 21:05

noli


People also ask

Is it possible to have a node js WebSocket client?

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.

How do I create a node js WebSocket server?

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 server in node js?

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.

What is WebSocket server and client?

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.


2 Answers

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

like image 69
jcolebrand Avatar answered Sep 23 '22 14:09

jcolebrand


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

like image 31
Josh Avatar answered Sep 24 '22 14:09

Josh