question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Override socket.onmessage

See original GitHub issue

Hi 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:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
insidewhycommented, Jun 30, 2017

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.

0reactions
insidewhycommented, Jun 30, 2017

Oh I forgot to let you know, the second argument is already a WebSocket factory.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found