Added support for http.
This commit is contained in:
parent
8baf9c2e5d
commit
966af246cf
@ -128,11 +128,16 @@ class RWebGuiApp extends HTMLElement {
|
|||||||
return this.app._ready && this.app.connected
|
return this.app._ready && this.app.connected
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get url() {
|
||||||
|
const protocol = window.location.protocol === "https:" ? "wss" : "ws";
|
||||||
|
return `${protocol}://${window.location.host}/ws/${this.uuid}`
|
||||||
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
// Always call super first in constructor
|
// Always call super first in constructor
|
||||||
super();
|
super();
|
||||||
if(!this.parent || !this.parent.app){
|
if(!this.parent || !this.parent.app){
|
||||||
this.ws = new WebSocket(`wss://${window.location.host}/ws/${this.uuid}`)
|
this.ws = new WebSocket(this.url)
|
||||||
const me = this
|
const me = this
|
||||||
this.ws.onopen = ()=>{
|
this.ws.onopen = ()=>{
|
||||||
me.connected = true;
|
me.connected = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user