1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-11 07:28:08 +03:00

web socket constructor

This commit is contained in:
Eugene Pankov 2021-06-22 11:51:52 +02:00
parent 49f1176591
commit 7cfed6ff23
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -23,9 +23,10 @@ export class SocketProxy extends Duplex {
super({
allowHalfOpen: false,
})
this.socket = new window['__connector__'].Socket(...args)
this.socket = window['__connector__'].createSocket(...args)
this.socket.connect$.subscribe(() => this['emit']('connect'))
this.socket.data$.subscribe(data => this['emit']('data', Buffer.from(data)))
this.socket.error$.subscribe(error => this['emit']('error', error))
}
connect (...args: any[]) {