sg-socket
v3.0.1
Published
WebSocket server for SUGOS
Downloads
25
Readme
sg-socket
WebSocket server for SUGOS
Installation
$ npm install sg-socket --save
Usage
'use strict'
const sgSocket = require('sg-socket')
const server = sgSocket(8080)
server.on('connection', (socket) => {
socket.emit('app:ready')
socket.on('app:hey', (data) => {
socket.broadcast.emit('hi', data.msg)
})
socket.on('disconnect', () => {
socket.broadcast.emit('goodbye, everyone')
})
})
License
This software is released under the Apache-2.0 License.