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.

Weird characters on websocket.send()

See original GitHub issue

When sending anything with a Websocket.Server instance, I always get the answer like this �{"success":true}��

This was the String { “success”: true }

No matter what I send with ws.send (where websocket is the server instance), I always get these weird characters. Even with an empty call ���

This was a completely empty send() call

Any idea on how to get rid of this? Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
braytakcommented, May 8, 2017

Well then allow me to speculate… Looks like the server is framing whatever you are sending…

Suggestion… run the client with developer tools to look at the frame character codes; see if they are the same whatever the source string…

Maybe that can provide a hint to whom wrote the server code…

Hope this helps

0reactions
ibccommented, May 8, 2017

Well, here you are assuming that WebSocket works fine via curl command. It may, or not. Probably it doesn’t.

Please, ensure that you are testing the WebSocket-Node library rather than Curl.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I fix the weird characters I receive from my websocket
I have tried adding a Base64 encoder and decoder but that didn't work. Also I removed all ws.send() functions and I noticed that...
Read more >
Special characters wrong encoding · Issue #498 - GitHub
I have a problem with the encoding of special characters. If I send e.g. ß from the client to the server and print...
Read more >
[RESOLVED] [2005] Sending special characters (å ä ö) using ...
Hey guys. I need to be able to send special characters such as é, å, ö using sockets. Lets say im making a...
Read more >
Web Socket Vulnerabilites - Cobalt.io
Sec-WebSocket-Accept header: The server concatenates the value obtained via the 'Sec-WebSocket-Key' client and the character string '258EAFA5- ...
Read more >
WebSocket.send() - Web APIs - MDN Web Docs - Mozilla
The WebSocket.send() method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value ...
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