Merge remote-tracking branch 'fork/patch-1' into add_device_pairing
This commit is contained in:
commit
6fe348ab4b
1 changed files with 4 additions and 2 deletions
|
@ -139,7 +139,7 @@ class SnapdropServer {
|
|||
|
||||
_keepAlive(peer) {
|
||||
this._cancelKeepAlive(peer);
|
||||
var timeout = 30000;
|
||||
var timeout = 500;
|
||||
if (!peer.lastBeat) {
|
||||
peer.lastBeat = Date.now();
|
||||
}
|
||||
|
@ -184,7 +184,9 @@ class Peer {
|
|||
}
|
||||
|
||||
_setIP(request) {
|
||||
if (request.headers['x-forwarded-for']) {
|
||||
if (request.headers['cf-connecting-ip']) {
|
||||
this.ip = request.headers['cf-connecting-ip'].split(/\s*,\s*/)[0];
|
||||
} else if (request.headers['x-forwarded-for']) {
|
||||
this.ip = request.headers['x-forwarded-for'].split(/\s*,\s*/)[0];
|
||||
} else {
|
||||
this.ip = request.connection.remoteAddress;
|
||||
|
|
Loading…
Reference in a new issue