dsh-pocket 1.13.0 → 1.13.1

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/lib/proxy.mjs +3 -0
  2. package/package.json +1 -1
package/lib/proxy.mjs CHANGED
@@ -445,6 +445,9 @@ export function createPocketProxy({ port = 3081, host = '0.0.0.0', upstream = DE
445
445
  if (heartbeat !== false) attachWebSocketHeartbeat(socket, heartbeat ?? {});
446
446
  // 任一端断开都要清理另一端(避免上游残留僵尸连接占用 dsh 连接槽)
447
447
  const teardown = () => { try { proxySocket.destroy(); } catch {} try { socket.destroy(); } catch {} };
448
+ // 上游侧透传 socket 的读错误(如 dsh web 重启/断开时的 ECONNRESET)必须
449
+ // 吞掉并清理对端,否则未处理的 'error' 事件会让整个 dsh web 进程崩溃退出。
450
+ proxySocket.on('error', () => { try { socket.destroy(); } catch {} });
448
451
  proxySocket.on('close', teardown);
449
452
  socket.on('close', teardown);
450
453
  });
package/package.json CHANGED
@@ -76,5 +76,5 @@
76
76
  "access": "public",
77
77
  "registry": "https://registry.npmjs.org/"
78
78
  },
79
- "version": "1.13.0"
79
+ "version": "1.13.1"
80
80
  }