Override socket.onmessage
See original GitHub issueHi James, first of all thanks for this library!
I need to override socket.onmessage
behaviour in order to prevent JSON.parse and handle some binary data instead of string messages: could you please give an example on how to do this? Perhaps passing a custom WebSocketFactory
as third param of websocketConnect
?
Tnx!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
How to override WebSocket onmessage Event - Stack Overflow
So I want to override websocket "message" method /onmessage event in following manner.
Read more >WebSocket: message event - Web APIs | MDN
The message event is fired when data is received through a WebSocket . Syntax. Use the event name in methods like addEventListener() ,...
Read more >websocket-sharp - GitHub Pages
If you override the WebSocketBehavior.OnMessage (MessageEventArgs) method, it will be called when the WebSocket used in a session in the service receives a ......
Read more >robtaussig/react-use-websocket - GitHub
Each component uses its own useWebSocket hook. This implementation takes advantage of passing an optional options object (documented below). Among setting event ...
Read more >18 Using the WebSocket Protocol in WebLogic Server
Creating a programmatic endpoint requires you to handle life cycle events for a WebSocket connection by overriding methods of the endpoint's superclass.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Cool so it’s 1.3 vs 0.7 (the more anal 0.3 part of me agrees with you). So I’ll make a new release with the json parsing handled by the user. Can be trivially handled by
map
anyway. Yeah I think this is the right way to go.Oh I forgot to let you know, the second argument is already a WebSocket factory.