Socket
Book a DemoInstallSign in
Socket

sockjs-websockify

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

sockjs-websockify

SockJS connection wrapper. Makes connections more web socket like.

unpublished
latest
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source

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');

Keywords

sockjs

FAQs

Package last updated on 25 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts