mirror of
https://github.com/wassname/talk.git
synced 2026-07-06 05:17:19 +08:00
Merge pull request #653 from coralproject/support-wss
Use wss when connection is secure
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user