We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version: Deno 2.1.4
Deno.serve({ port: 8000, hostname: "127.0.0.1" }, (req) => { const { socket, response } = Deno.upgradeWebSocket(req); socket.addEventListener("close", (e) => { // e.code always 1005 console.log(`server socket close code: ${e.code}`); }); return response; }); const socket = new WebSocket("ws://127.0.0.1:8000"); setTimeout(() => { socket.close(1000); }, 3000); socket.addEventListener("close", (e) => { // e.code always 1005 console.log(`client socket close code: ${e.code}`); });
The text was updated successfully, but these errors were encountered:
What's more interesting is that if you specify the reason parameter, the code will be handled properly.
Sorry, something went wrong.
fix(ext/websocket): Fix close code without reason (#27578)
e233173
Fixes #27566 The close code wasn't sent if reason was None, defaulting to 1005. This patch allows sending close code without reason.
f813ab9
Successfully merging a pull request may close this issue.
Version: Deno 2.1.4
The text was updated successfully, but these errors were encountered: