mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-08 13:30:02 +00:00
web socket constructor
This commit is contained in:
parent
49f1176591
commit
7cfed6ff23
@ -23,9 +23,10 @@ export class SocketProxy extends Duplex {
|
|||||||
super({
|
super({
|
||||||
allowHalfOpen: false,
|
allowHalfOpen: false,
|
||||||
})
|
})
|
||||||
this.socket = new window['__connector__'].Socket(...args)
|
this.socket = window['__connector__'].createSocket(...args)
|
||||||
this.socket.connect$.subscribe(() => this['emit']('connect'))
|
this.socket.connect$.subscribe(() => this['emit']('connect'))
|
||||||
this.socket.data$.subscribe(data => this['emit']('data', Buffer.from(data)))
|
this.socket.data$.subscribe(data => this['emit']('data', Buffer.from(data)))
|
||||||
|
this.socket.error$.subscribe(error => this['emit']('error', error))
|
||||||
}
|
}
|
||||||
|
|
||||||
connect (...args: any[]) {
|
connect (...args: any[]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user