Ensure we use proper URL to connect to websocket

This commit is contained in:
Eliot Berriot 2018-06-23 19:41:58 +02:00
parent 7d60155b0f
commit 63dd5b2f06
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
2 changed files with 8 additions and 8 deletions

View file

@ -78,8 +78,11 @@ export default {
// let token = 'test'
const bridge = new WebSocketBridge()
this.bridge = bridge
let url = this.$store.getters['instance/absoluteUrl'](`api/v1/instance/activity?token=${token}`)
url = url.replace('http://', 'ws://')
url = url.replace('https://', 'wss://')
bridge.connect(
`/api/v1/instance/activity?token=${token}`,
url,
null,
{reconnectInterval: 5000})
bridge.listen(function (event) {