(type, topics, ws)
| 14 | WebWS = self.WebSocket || self.MozWebSocket |
| 15 | } |
| 16 | const subOrUnsub = (type, topics, ws) => { |
| 17 | if (!Array.isArray(topics) && typeof topics === 'string') { |
| 18 | topics = [topics] // always send array |
| 19 | } |
| 20 | const msg = { |
| 21 | type, |
| 22 | topics |
| 23 | } |
| 24 | ws.send(JSON.stringify(msg)) |
| 25 | } |
| 26 | |
| 27 | module.exports = { |
| 28 | websocketUrl: (path) => { |