feat: 优化WebSocket客户端 支持WSS

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2021-08-05 14:35:17 +08:00
parent 2fd10140cf
commit cabf09e247
3 changed files with 40 additions and 7 deletions

View File

@@ -61,7 +61,7 @@ export class WebSocket extends EventEmitter {
manager.del(this)
})
this.client.on('error', (event) => this.onerror?.(event))
setTimeout(() => this.client.connect(), 20)
this.client.connect()
}
get id() {
return this.client.id