ctrl-web-socket-server

2.0.1 • Public • Published

ctrl-web-socket-server

Build Status Codacy Badge Codacy Badge

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)

Readme

Keywords

Package Sidebar

Install

npm i ctrl-web-socket-server

Weekly Downloads

2

Version

2.0.1

License

MIT

Last publish

Collaborators

  • suitupalex