mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-22 07:46:17 -04:00
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) {
|
_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…
Add table
Add a link
Reference in a new issue