Name: single-socket
Owner: Learn.co
Description: Share a single websocket across Node processes
Created: 2016-08-19 00:11:56.0
Updated: 2016-08-20 00:37:49.0
Pushed: 2016-11-09 16:37:15.0
Homepage: null
Size: 105
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Note: This project is experimental for now and still under active development
Share a single websocket connection across Node processes.
SingleSocket uses a local socket (via node-ipc) to route clients through a single websocket connection.
npm install single-socket --save
t SingleSocket = require('single-socket')
client = new SingleSocket('ws://echo.websocket.org')
nt.on('error', (err) => {
nsole.error(err)
nt.on('open', () => {
nsole.log('Client Connected')
nt.on('close', () => {
nsole.log('Client Closed')
nt.on('message', (msg) => {
nsole.log(msg)
nt.send('hello world')