mirror of
https://github.com/m1k1o/neko.git
synced 2025-08-06 10:20:26 +02:00
add new api internal class.
This commit is contained in:
parent
84e4f22524
commit
ac9ac7ac69
3 changed files with 39 additions and 3 deletions
|
@ -32,8 +32,7 @@ export class NekoWebSocket extends EventEmitter<NekoWebSocketEvents> {
|
|||
|
||||
this.emit('connecting')
|
||||
|
||||
const ws_url = url.replace(/^http/, 'ws').replace(/\/$|\/ws$/, '')
|
||||
this._ws = new WebSocket(`${ws_url}/ws?id=${encodeURIComponent(id)}&secret=${encodeURIComponent(secret)}`)
|
||||
this._ws = new WebSocket(`${url}/ws?id=${encodeURIComponent(id)}&secret=${encodeURIComponent(secret)}`)
|
||||
this._log.debug(`connecting to ${this._ws.url}`)
|
||||
|
||||
this._ws.onopen = this.onConnected.bind(this)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue