chore(gateway): log pre-hello ws closures
This commit is contained in:
@@ -499,6 +499,11 @@ export async function startGatewayServer(
|
|||||||
close();
|
close();
|
||||||
});
|
});
|
||||||
socket.once("close", (code, reason) => {
|
socket.once("close", (code, reason) => {
|
||||||
|
if (!client) {
|
||||||
|
logWarn(
|
||||||
|
`gateway/ws closed before hello conn=${connId} remote=${remoteAddr ?? "?"} code=${code ?? "n/a"} reason=${reason?.toString() || "n/a"}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
if (client && isWebchatHello(client.hello)) {
|
if (client && isWebchatHello(client.hello)) {
|
||||||
logInfo(
|
logInfo(
|
||||||
`webchat disconnected code=${code} reason=${reason?.toString() || "n/a"} conn=${connId}`,
|
`webchat disconnected code=${code} reason=${reason?.toString() || "n/a"} conn=${connId}`,
|
||||||
@@ -529,7 +534,12 @@ export async function startGatewayServer(
|
|||||||
});
|
});
|
||||||
|
|
||||||
const handshakeTimer = setTimeout(() => {
|
const handshakeTimer = setTimeout(() => {
|
||||||
if (!client) close();
|
if (!client) {
|
||||||
|
logWarn(
|
||||||
|
`gateway/ws handshake timeout conn=${connId} remote=${remoteAddr ?? "?"}`,
|
||||||
|
);
|
||||||
|
close();
|
||||||
|
}
|
||||||
}, HANDSHAKE_TIMEOUT_MS);
|
}, HANDSHAKE_TIMEOUT_MS);
|
||||||
|
|
||||||
socket.on("message", async (data) => {
|
socket.on("message", async (data) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user