Add support for websockets over HTTP

in addition to HTTPS
This commit is contained in:
Lance Edgar 2022-12-25 15:37:54 -06:00
parent c389ebabd0
commit 0a0b471a03
2 changed files with 4 additions and 4 deletions

View file

@ -200,8 +200,8 @@
ThisPage.mounted = function() {
## TODO: should be a cleaner way to get this url?
let url = '${request.route_url('ws.datasync.status')}'
url = url.replace(/^https?:/, 'wss:')
let url = '${url('ws.datasync.status')}'
url = url.replace(/^http(s?):/, 'ws$1:')
this.ws = new WebSocket(url)
let that = this

View file

@ -211,8 +211,8 @@
ThisPage.methods.establishWebsocket = function() {
## TODO: should be a cleaner way to get this url?
url = '${request.route_url('ws.upgrades.execution_progress', _query={'uuid': instance.uuid})}'
url = url.replace(/^https?:/, 'wss:')
let url = '${url('ws.upgrades.execution_progress', _query={'uuid': instance.uuid})}'
url = url.replace(/^http(s?):/, 'ws$1:')
this.ws = new WebSocket(url)