Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Web Socket client for NodeJS
branch: close-handshake

This branch is 2 commits ahead, 41 commits behind pgriess:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
test
LICENSE
Makefile
README.md

README.md

A prototype Web Socket client implementation for node.js.

Tested with miksago/node-websocket-server v1.2.00.

Requires ry/node@187f191558ef45562865e071fdcd11e1dbec79df (as yet unreleased).

Usage

var sys = require('sys');
var WebSocket = require('websocket').WebSocket;

var ws = new WebSocket('ws://localhost:8000/biff', 'borf');
ws.addListener('data', function(buf) {
    sys.debug('Got data: ' + sys.inspect(buf));
});
ws.onmessage = function(m) {
    sys.debug('Got message: ' + m);
}

API

This supports the send() and onmessage() APIs. The WebSocket object will also emit data events that are node Buffer objects, in case you want to work with something lower-level than strings.

Something went wrong with that request. Please try again.