You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When receiving a message that is a stringified json object the onMessage function is called twice. First with the string version and then with the string parsed to a JSON object.
Server setup:
var server = require('websocket').server;
var socket = new server({
httpServer: http.createServer().listen(8008),
});
socket.on('request', function(request) {
const connection = request.accept(null, request.origin);
connection.send("{\"test\":\"message\"}");
})
When receiving a message that is a stringified json object the onMessage function is called twice. First with the string version and then with the string parsed to a JSON object.
Server setup:
Client setup
console log
The text was updated successfully, but these errors were encountered: