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
ws.close(1000, 'Normal closure') 会触发失败。提示信息:WS_ERR_INVALID_CLOSE_CODE 10000
8.18.0
19.2.0
window10
The text was updated successfully, but these errors were encountered:
Please share a minimal reproducible example. I can't reproduce the issue:
import assert from 'node:assert'; import { WebSocket, WebSocketServer } from 'ws'; const wss = new WebSocketServer({ port: 0 }, function () { const ws = new WebSocket(`ws://127.0.0.1:${wss.address().port}`); ws.on('open', function () { ws.close(1000, 'Normal closure'); }); }); wss.on('connection', function (ws) { ws.on('close', function (code, message) { assert.strictEqual(code, 1000); assert.strictEqual(message.toString(), 'Normal closure'); wss.close(); }); });
Sorry, something went wrong.
No branches or pull requests
Is there an existing issue for this?
Description
ws.close(1000, 'Normal closure') 会触发失败。提示信息:WS_ERR_INVALID_CLOSE_CODE 10000
ws version
8.18.0
Node.js Version
19.2.0
System
window10
Expected result
Actual result
Attachments
The text was updated successfully, but these errors were encountered: