Skip to content

Instantly share code, notes, and snippets.

View ophentis's full-sized avatar

Willy Tseng ophentis

View GitHub Profile
anonymous
anonymous / simple echo websocket server
Created November 2, 2010 01:48
for nodejs. need do a lot refactoring though.
var net = require('net'),
sys = require('sys');
function WSServer(port, ip) {
if(!port) throw('You should assign a port to listen.');
this.port = port;
this.ip = ip||'127.0.0.1';
this.server = null;
var clients = {};
var state = {