@ccci/micro-server 1.0.57 → 1.0.58

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -119119,21 +119119,21 @@ class WebSocketServer {
119119
119119
  },
119120
119120
  websocket: {
119121
119121
  async message(ws, message) {
119122
- let websocket = handlers.find((rec) => rec.path === "echo");
119122
+ let websocket = handlers.find((rec) => rec.path === ws.data.channel);
119123
119123
  if (websocket) {
119124
119124
  await websocket.handler.accept(ws, message);
119125
119125
  return;
119126
119126
  }
119127
119127
  },
119128
119128
  async open(ws) {
119129
- let websocket = handlers.find((rec) => rec.path === "echo");
119129
+ let websocket = handlers.find((rec) => rec.path === ws.data.channel);
119130
119130
  if (websocket) {
119131
119131
  await websocket.handler.connect(ws);
119132
119132
  return;
119133
119133
  }
119134
119134
  },
119135
119135
  async close(ws, code, reason) {
119136
- let websocket = handlers.find((rec) => rec.path === "echo");
119136
+ let websocket = handlers.find((rec) => rec.path === ws.data.channel);
119137
119137
  if (websocket) {
119138
119138
  websocket.handler.disconnect(ws, code, reason);
119139
119139
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.0.57",
3
+ "version": "1.0.58",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",