@arcblock/ws 1.16.13 → 1.16.16
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/server/index.js +3 -3
- package/package.json +4 -4
package/lib/server/index.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
const EventEmitter = require('events');
|
2
2
|
const cluster = require('cluster');
|
3
3
|
|
4
|
-
const
|
4
|
+
const { nanoid } = require('nanoid');
|
5
5
|
const WebSocket = require('ws');
|
6
6
|
const eventHub = cluster.isMaster ? require('@arcblock/event-hub/single') : require('@arcblock/event-hub');
|
7
7
|
|
@@ -128,7 +128,7 @@ class WsServer extends EventEmitter {
|
|
128
128
|
}
|
129
129
|
|
130
130
|
const enableLog = options.enableLog !== undefined ? !!options.enableLog : true;
|
131
|
-
const replyId =
|
131
|
+
const replyId = nanoid();
|
132
132
|
|
133
133
|
// Count of clients what will receive the message
|
134
134
|
// The count is NOT reliable
|
@@ -239,7 +239,7 @@ class WsServer extends EventEmitter {
|
|
239
239
|
* @param {socket} socket
|
240
240
|
*/
|
241
241
|
async onWssConnection(socket) {
|
242
|
-
socket.id =
|
242
|
+
socket.id = nanoid();
|
243
243
|
refreshHeartbeat(socket);
|
244
244
|
this.logger.debug('socket connected', { id: socket.id });
|
245
245
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ws",
|
3
|
-
"version": "1.16.
|
3
|
+
"version": "1.16.16",
|
4
4
|
"description": "OCAP Chain websocket server and client",
|
5
5
|
"keywords": [
|
6
6
|
"websocket"
|
@@ -34,15 +34,15 @@
|
|
34
34
|
"url": "https://github.com/ArcBlock/asset-chain/issues"
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
|
-
"@arcblock/event-hub": "1.16.
|
37
|
+
"@arcblock/event-hub": "1.16.16",
|
38
38
|
"debug": "^4.3.3",
|
39
39
|
"eventemitter3": "^4.0.4",
|
40
|
+
"nanoid": "3.x",
|
40
41
|
"phoenix": "1.5.12",
|
41
|
-
"uuid": "^8.3.0",
|
42
42
|
"ws": "^8.2.2"
|
43
43
|
},
|
44
44
|
"devDependencies": {
|
45
45
|
"get-port": "^5.1.1"
|
46
46
|
},
|
47
|
-
"gitHead": "
|
47
|
+
"gitHead": "051f9620995cf24407374cc4811b0fa6ed6dc7ca"
|
48
48
|
}
|