web socket constructor

上级 49f11765
......@@ -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[]) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册