mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-21 22:54:53 +08:00
Decrease redundancy by changing the way the websocket fallback is included; Adding new env var SIGNALING_SERVER to host client files but use another server for signaling.
This commit is contained in:
@@ -17,8 +17,8 @@ export default class Peer {
|
||||
// set peer id
|
||||
this._setPeerId(request);
|
||||
|
||||
// is WebRTC supported ?
|
||||
this.rtcSupported = request.url.indexOf('webrtc') > -1;
|
||||
// is WebRTC supported
|
||||
this._setRtcSupported(request);
|
||||
|
||||
// set name
|
||||
this._setName(request);
|
||||
@@ -133,6 +133,11 @@ export default class Peer {
|
||||
}
|
||||
}
|
||||
|
||||
_setRtcSupported(request) {
|
||||
const searchParams = new URL(request.url, "http://server").searchParams;
|
||||
this.rtcSupported = searchParams.get("webrtc_supported") === "true";
|
||||
}
|
||||
|
||||
_setName(req) {
|
||||
let ua = parser(req.headers['user-agent']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user