mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 14:01:56 +08:00
Fix: use toString for url instance
This commit is contained in:
parent
cf9da3125e
commit
5aecab9bb8
@ -35,7 +35,7 @@ export class StreamReader<T> {
|
|||||||
url.protocol = location.protocol === 'http:' ? 'ws:' : 'wss:'
|
url.protocol = location.protocol === 'http:' ? 'ws:' : 'wss:'
|
||||||
url.searchParams.set('token', this.config.token)
|
url.searchParams.set('token', this.config.token)
|
||||||
|
|
||||||
const connection = new WebSocket(url.toJSON())
|
const connection = new WebSocket(url.toString())
|
||||||
connection.addEventListener('message', msg => {
|
connection.addEventListener('message', msg => {
|
||||||
const data = JSON.parse(msg.data)
|
const data = JSON.parse(msg.data)
|
||||||
this.EE.emit('data', [data])
|
this.EE.emit('data', [data])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user