Update.
This commit is contained in:
parent
4ae846cf8b
commit
fb7cb35921
@ -208,9 +208,11 @@ class Socket extends EventHandler {
|
||||
ws = null
|
||||
isConnected = null
|
||||
isConnecting = null
|
||||
url = null
|
||||
connectPromises = []
|
||||
constructor() {
|
||||
super()
|
||||
this.url = window.location.hostname == 'localhost' ? 'ws://localhost/rpc.ws' : 'wss://' + window.location.hostname +'/rpc.ws'
|
||||
this.ensureConnection()
|
||||
}
|
||||
_camelToSnake(str) {
|
||||
@ -254,7 +256,8 @@ class Socket extends EventHandler {
|
||||
}
|
||||
return new Promise((resolve,reject)=>{
|
||||
me.connectPromises.push(resolve)
|
||||
const ws = new WebSocket("ws://localhost:8081/rpc.ws")
|
||||
|
||||
const ws = new WebSocket(this.url)
|
||||
ws.onopen = (event) => {
|
||||
me.ws = ws
|
||||
me.isConnected = true
|
||||
|
Loading…
Reference in New Issue
Block a user