Improve transport safety and log redaction

This commit is contained in:
nav
2026-04-08 23:03:54 +00:00
parent 075fcb7974
commit 4f20ec3fd7
4 changed files with 207 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
import { WebSocketServer, WebSocket, RawData } from "ws";
import type { YonexusServerConfig } from "./config.js";
import type { ClientRecord } from "./persistence.js";
import { safeErrorMessage } from "./logging.js";
export interface ClientConnection {
readonly identifier: string | null;
@@ -221,7 +221,7 @@ export class YonexusServerTransport implements ServerTransport {
ws.on("error", (error: Error) => {
// Log error but let close handler clean up
console.error("WebSocket error:", error.message);
console.error("[Yonexus.Server] WebSocket error:", safeErrorMessage(error));
});
if (this.options.onConnect) {