0.0.4 • Published 11 years ago

socket-server v0.0.4

Weekly downloads
20
License
-
Repository
github
Last release
11 years ago

socket-server

Websocket server - extends the excellent https://github.com/einaros/ws

// same params as ws
var svr = require('./socketserver.js')({port: 8080});

// hook connection attempt
svr.hook = function(ws){
	console.log('hooked');
	// set ws.deny = true to deny connection
	return ws;
}

// list of connected clients
var clients = svr.clientlist;

// send object or string to all clients
svr.sendAll({some: 'thing'});

// send to a particular client id only
svr.send('adsed290', {some: 'thing'});

// view debugging info
$ debug=1 myapp.js
0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago