Browse Source

Update Snapdrop client to be proxy friendly.

Adds location.pathname to the socket location, this is needed to make snapdrop proxiable which allows it to be used as Home Assistant Addon.
deftdawg 4 years ago
parent
commit
5e304514b6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      client/scripts/network.js

+ 1 - 1
client/scripts/network.js

@@ -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;
     }
     }