ctrl-web-socket-server
v2.0.1
Published
An abstraction around socket.io.
Downloads
2
Readme
ctrl-web-socket-server
An abstraction around socket.io.
Installation
Yarn is recommended for installation.
$ yarn add ctrl-web-socket-server
But you can still use npm.
$ npm install --save ctrl-web-socket-server
Usage
Simple (built-in NodeJS HTTP Server):
const CtrlWebSocketServer = require('ctrl-web-socket-server')
const http = require('http')
const httpServer = http.createServer()
const ctrlWebSocketServer = new CtrlWebSocketServer({httpServer})
httpServer.listen(8080)
Using the ctrl
framework:
const CtrlHttpServer = require('ctrl-http-server')
const CtrlWebSocketServer = require('ctrl-web-socket-server')
const httpServer = new CtrlHttpServer({port: 8080})
const webSocketServer = new CtrlWebSocketServer({httpServer})
httpServer.start()
Methods
Full documentation to come soon!
License
Copyright (c) 2016 Martin Experiments LLC
MIT (https://www.opensource.org/licenses/MIT)