Add support for websockets over HTTP
in addition to HTTPS
This commit is contained in:
parent
c389ebabd0
commit
0a0b471a03
|
@ -200,8 +200,8 @@
|
||||||
ThisPage.mounted = function() {
|
ThisPage.mounted = function() {
|
||||||
|
|
||||||
## TODO: should be a cleaner way to get this url?
|
## TODO: should be a cleaner way to get this url?
|
||||||
let url = '${request.route_url('ws.datasync.status')}'
|
let url = '${url('ws.datasync.status')}'
|
||||||
url = url.replace(/^https?:/, 'wss:')
|
url = url.replace(/^http(s?):/, 'ws$1:')
|
||||||
|
|
||||||
this.ws = new WebSocket(url)
|
this.ws = new WebSocket(url)
|
||||||
let that = this
|
let that = this
|
||||||
|
|
|
@ -211,8 +211,8 @@
|
||||||
ThisPage.methods.establishWebsocket = function() {
|
ThisPage.methods.establishWebsocket = function() {
|
||||||
|
|
||||||
## TODO: should be a cleaner way to get this url?
|
## TODO: should be a cleaner way to get this url?
|
||||||
url = '${request.route_url('ws.upgrades.execution_progress', _query={'uuid': instance.uuid})}'
|
let url = '${url('ws.upgrades.execution_progress', _query={'uuid': instance.uuid})}'
|
||||||
url = url.replace(/^https?:/, 'wss:')
|
url = url.replace(/^http(s?):/, 'ws$1:')
|
||||||
|
|
||||||
this.ws = new WebSocket(url)
|
this.ws = new WebSocket(url)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue