0.0.5 • Published 11 years ago

sockjs-websockify v0.0.5

Weekly downloads
2
License
MIT
Repository
-
Last release
11 years ago

sockjs-websockify

Wrapper around SockJS connections. Makes them more web socket like.

Sadly sockjs-node connections have different API than web sockets. ㅜㅜ

Installation

$ npm install sockjs-websockify

Usage

var http        = require('http'),
    sockjs      = require('sockjs'),
    websockify  = require('sockjs-websockify'),
    wss         = sockjs.createServer();

wss.on('connection', function(conn) {

    // wrap the connection to act more like a websocket.
    var socket = websockify(conn);

    socket.send('hello');
    socket.addEventListener('message', console.log.bind(console));
});

var server = http.createServer();
wss.installHandlers(server, { prefix:'/sockjs' });
server.listen(3000, '0.0.0.0');
0.0.5

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago

0.0.0

11 years ago