MCPcopy
hub / github.com/SnapDrop/snapdrop / constructor

Method constructor

server/index.js:19–28  ·  view source on GitHub ↗
(port)

Source from the content-addressed store, hash-verified

17class SnapdropServer {
18
19 constructor(port) {
20 const WebSocket = require('ws');
21 this._wss = new WebSocket.Server({ port: port });
22 this._wss.on('connection', (socket, request) => this._onConnection(new Peer(socket, request)));
23 this._wss.on('headers', (headers, response) => this._onHeaders(headers, response));
24
25 this._rooms = {};
26
27 console.log('Snapdrop is running on port', port);
28 }
29
30 _onConnection(peer) {
31 this._joinRoom(peer);

Callers

nothing calls this directly

Calls 3

_onConnectionMethod · 0.95
_onHeadersMethod · 0.95
onMethod · 0.80

Tested by

no test coverage detected