Skip to content

Commit

Permalink
Restoring 1006->1011 handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dolled-possum committed Jan 3, 2025
1 parent be1573a commit b590b8a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ wss.on('connection', (clientSocket, req, remoteSocket) => {
// Close events
clientSocket.on('close', (code, reason) => {
tsLog(`[client #${clientId}] Closed (code=${code}, reason=${reason})`);
if (code !== 1006) remoteSocket.close(code, reason);
if (code !== 1006) {
remoteSocket.close(code, reason);
} else {
tsLog(`[client #${clientId} -> remote] Intercepting 1006, sending 1011 to remote`);
remoteSocket.close(1011, reason);
}
});
remoteSocket.on('close', (code, reason) => {
tsLog(`[remote -> client #${clientId}] Closed (code=${code}, reason=${reason})`);
Expand Down

0 comments on commit b590b8a

Please sign in to comment.