data strings changes over socket
See original GitHub issueNote: for support questions, please use one of these channels: stackoverflow or slack
You want to:
- report a bug
- request a feature
Current behaviour
when emitting an object as data and within it using a string of ≥
(or the unicode \u2265
) it turns it to the string letter e
and ≤
trurns to d
Steps to reproduce (if the current behaviour is a bug)
client side
channel.emit('data', {data:'≥'});
server side
socket.on('data',({data:bla})=>{
console.log(bla); // prints 'e'
});
Note: the best way to get a quick answer is to provide a failing test case, by forking the following fiddle for example.
Expected behaviour
that the data will stay the same consistently
Setup
- OS: Windows
- browser: Chrome 62
- socket.io version: 1.7.2
Other information (e.g. stacktraces, related issues, suggestions how to fix)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
string in variable changes before sending through socket
I have the following scenario, a two socket connection (one acts as a server and the other one as a connection to a...
Read more >Node.js v19.3.0 Documentation
Example: sending a server object; Example: sending a socket object ... Non-backward compatible changes or removal may occur in any future release.
Read more >Writing WebSocket client applications - Web APIs | MDN
These strings are used to indicate sub-protocols, so that a single server can implement multiple WebSocket sub-protocols (for example, ...
Read more >socket — Low-level networking interface — Python 3.11.1 ...
A string or bytes-like object can be used for either type of address when passing it as an argument. Changed in version 3.3:...
Read more >Writing the Server Side of a Socket (The Java™ Tutorials ...
The accept method waits until a client starts up and requests a connection on the host and port of this server. (Let's assume...
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 FreeTop 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
Top GitHub Comments
tried it with 2.0.4, still happens… fixed it with encoding and decoding the data with this code: client side
server side
Yeah that’s seems to be working. Thanks!