We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ddde7b commit d6b0f69Copy full SHA for d6b0f69
server/debug/websocket-analyzer.ts
@@ -0,0 +1,12 @@
1
+import { Server } from 'socket.io';
2
+
3
+export function getSocketsForNamespaces(io: Server) {
4
+ const _nsps = io._nsps;
5
6
+ const namespaces = Array.from(_nsps.keys());
7
+ const socketsForNamespaces = namespaces.map((namespace) => {
8
+ return { [namespace]: Array.from(_nsps.get(namespace).sockets.keys()) };
9
+ });
10
11
+ return socketsForNamespaces;
12
+}
0 commit comments