wsstream

0.2.0 • Public • Published

wsstream

stream over websockets

only works in node v0.10

on the server

var WebSocketServer = require('ws').Server;
var WsStream = require('wsstream');
var server = new WebSocketServer({ port: 7981 });
server.on('connection', onConnection);
function onConnection(connection) {
  var wsstream = WsStream(connection);
  // .. stuff
  wsstream.close();
}

on the browser

use browserify

var WsStream = require('wsstream');
var stream = WsStream('ws://localhost:7981');
// .. stuff

check the test folder for details

Readme

Keywords

none

Package Sidebar

Install

npm i wsstream

Weekly Downloads

3

Version

0.2.0

License

MIT

Last publish

Collaborators

  • soarez