Prepare for HTTPS

This commit is contained in:
maciejhirsz
2018-07-18 13:06:25 +02:00
parent d10fb4a1e1
commit 7b57cb99dd
4 changed files with 49 additions and 28 deletions
+3 -1
View File
@@ -11,7 +11,9 @@ export class Connection {
return new Connection(await Connection.socket(), update);
}
private static readonly address = `ws://${window.location.hostname}:8080`;
private static readonly address = window.location.protocol === 'https:'
? `wss://${window.location.hostname}/feed/`
: `ws://${window.location.hostname}:8080`;
private static async socket(): Promise<WebSocket> {
let socket = await Connection.trySocket();