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
See: https://github.com/websockets/ws/releases/tag/8.0.0
Previously it used the same API as the client standard, but now it needs you to specifically decode messages:
websocket.on('message', function message(data, isBinary) { const message = isBinary ? data : data.toString(); // Continue as before. });
The text was updated successfully, but these errors were encountered:
Actually, looking closer, it looks like the release notes may have been slightly confusing / misleading: it seems only the events emitted are now non-standard, so on("message", (data, isBinary) => {}), but the onmessage handlers are still standard: https://github.com/websockets/ws/blob/5e4149ec6a82e0367a925881abca5667667030e9/lib/event-target.js#L193-L200
on("message", (data, isBinary) => {})
onmessage
@lpinca could you confirm this API change?
Sorry, something went wrong.
Correct, and it has always been like this (even before ws@8.0.0). Only listeners added via the EventTarget interface receives "standard" Events.
ws@8.0.0
EventTarget
Event
No branches or pull requests
See: https://github.com/websockets/ws/releases/tag/8.0.0
Previously it used the same API as the client standard, but now it needs you to specifically decode messages:
The text was updated successfully, but these errors were encountered: