Merge remote-tracking branch 'fork/patch-1' into add_device_pairing
This commit is contained in:
commit
6fe348ab4b
|
@ -139,7 +139,7 @@ class SnapdropServer {
|
||||||
|
|
||||||
_keepAlive(peer) {
|
_keepAlive(peer) {
|
||||||
this._cancelKeepAlive(peer);
|
this._cancelKeepAlive(peer);
|
||||||
var timeout = 30000;
|
var timeout = 500;
|
||||||
if (!peer.lastBeat) {
|
if (!peer.lastBeat) {
|
||||||
peer.lastBeat = Date.now();
|
peer.lastBeat = Date.now();
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,9 @@ class Peer {
|
||||||
}
|
}
|
||||||
|
|
||||||
_setIP(request) {
|
_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];
|
this.ip = request.headers['x-forwarded-for'].split(/\s*,\s*/)[0];
|
||||||
} else {
|
} else {
|
||||||
this.ip = request.connection.remoteAddress;
|
this.ip = request.connection.remoteAddress;
|
||||||
|
|
Loading…
Reference in New Issue