Merge pull request #1 from deftdawg/deftdawg-location-pathname-homeassistant

Update Snapdrop client to be proxy friendly.
This commit is contained in:
deftdawg 2021-04-07 15:32:46 -04:00 committed by GitHub
commit 95921ee723
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,7 +58,7 @@ class ServerConnection {
// hack to detect if deployment or development environment // hack to detect if deployment or development environment
const protocol = location.protocol.startsWith('https') ? 'wss' : 'ws'; const protocol = location.protocol.startsWith('https') ? 'wss' : 'ws';
const webrtc = window.isRtcSupported ? '/webrtc' : '/fallback'; const webrtc = window.isRtcSupported ? '/webrtc' : '/fallback';
const url = protocol + '://' + location.host + '/server' + webrtc; const url = protocol + '://' + location.host + location.pathname + '/server' + webrtc;
return url; return url;
} }