@mixd-id/web-scaffold 0.1.230406303 → 0.1.230406305
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils/wss.js +5 -1
package/package.json
CHANGED
package/src/utils/wss.js
CHANGED
|
@@ -97,11 +97,14 @@ class WSS extends EventEmitter2{
|
|
|
97
97
|
this._opt = opt
|
|
98
98
|
this._instance = new WebSocket.Server(opt);
|
|
99
99
|
|
|
100
|
+
console.log('WSS', process.env.REDIS_HOST, process.env.REDIS_PORT)
|
|
100
101
|
this._client = redis.createClient({
|
|
101
102
|
host: process.env.REDIS_HOST ?? '127.0.0.1',
|
|
102
103
|
port: process.env.REDIS_PORT ?? 6379
|
|
103
104
|
})
|
|
104
|
-
this._client.connect()
|
|
105
|
+
this._client.connect()
|
|
106
|
+
.then()
|
|
107
|
+
.catch(err => console.log('#err1', err))
|
|
105
108
|
|
|
106
109
|
this._instance.on('connection', async (socket, req) => {
|
|
107
110
|
|
|
@@ -228,6 +231,7 @@ class WSS extends EventEmitter2{
|
|
|
228
231
|
await subscriber.connect()
|
|
229
232
|
}
|
|
230
233
|
catch(e){
|
|
234
|
+
console.log('#err2', err)
|
|
231
235
|
return socket.close(1002, e.message);
|
|
232
236
|
}
|
|
233
237
|
|