Method
constructor
({
port = 0,
server,
customHandleUpgradeHeaders = [],
})
Source from the content-addressed store, hash-verified
| 7 | |
| 8 | class WebSocketServer { |
| 9 | constructor({ |
| 10 | port = 0, |
| 11 | server, |
| 12 | customHandleUpgradeHeaders = [], |
| 13 | }) { |
| 14 | this.port = port; |
| 15 | this.server = server || http.createServer(); |
| 16 | this.clients = new Set(); |
| 17 | this.customHandleUpgradeHeaders = customHandleUpgradeHeaders; |
| 18 | |
| 19 | this.server.on('upgrade', this.handleUpgrade.bind(this)); |
| 20 | } |
| 21 | |
| 22 | start() { |
| 23 | return new Promise((resolve) => { |
Callers
nothing calls this directly
Tested by
no test coverage detected