ws.js 278 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 'use strict'; class Ws { constructor() { } init(io) { this.io = io; this.io.on('connection', this.onConn); } broadcast(path, msg) { this.io.emit(path, msg); } onConn(ws) { } } let ws = new Ws(); export default ws;