Use wss when connection is secure

This commit is contained in:
Chi Vinh Le
2017-06-07 01:32:37 +07:00
parent 9963f6d337
commit 7cb05cebef
+2 -1
View File
@@ -9,7 +9,8 @@ export function getClient() {
return client;
}
const wsClient = new SubscriptionClient(`ws://${location.host}/api/v1/live`, {
const protocol = location.protocol === 'https:' ? 'wss' : 'ws';
const wsClient = new SubscriptionClient(`${protocol}://${location.host}/api/v1/live`, {
reconnect: true
});