update client to include username when connecting to websocket.

This commit is contained in:
Miroslav Šedivý 2024-09-07 22:54:05 +02:00
parent 13f91477df
commit daf8f79eb5

View file

@ -63,7 +63,9 @@ export abstract class BaseClient extends EventEmitter<BaseEvents> {
this[EVENT.CONNECTING]()
try {
this._ws = new WebSocket(`${url}?password=${encodeURIComponent(password)}`)
this._ws = new WebSocket(
`${url}?password=${encodeURIComponent(password)}&username=${encodeURIComponent(displayname)}`,
)
this.emit('debug', `connecting to ${this._ws.url}`)
this._ws.onmessage = this.onMessage.bind(this)
this._ws.onerror = () => this.onError.bind(this)