mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-20 15:06:15 -04:00
Merge remote-tracking branch 'fork/customise_server_port' into add_device_pairing
This commit is contained in:
commit
f9a22e5ae4
1 changed files with 7 additions and 7 deletions
|
@ -16,9 +16,9 @@ const { uniqueNamesGenerator, animals, colors } = require('unique-names-generato
|
||||||
|
|
||||||
class SnapdropServer {
|
class SnapdropServer {
|
||||||
|
|
||||||
constructor(port) {
|
constructor(host, port) {
|
||||||
const WebSocket = require('ws');
|
const WebSocket = require('ws');
|
||||||
this._wss = new WebSocket.Server({ port: port });
|
this._wss = new WebSocket.Server({ host: host, port: port });
|
||||||
this._wss.on('connection', (socket, request) => this._onConnection(new Peer(socket, request)));
|
this._wss.on('connection', (socket, request) => this._onConnection(new Peer(socket, request)));
|
||||||
this._wss.on('headers', (headers, response) => this._onHeaders(headers, response));
|
this._wss.on('headers', (headers, response) => this._onHeaders(headers, response));
|
||||||
|
|
||||||
|
@ -302,4 +302,4 @@ Object.defineProperty(String.prototype, 'hashCode', {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const server = new SnapdropServer(process.env.PORT || 3000);
|
const server = new SnapdropServer(process.env.HOST || null, process.env.PORT || 3000);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue