I have client - server application, server side on Node.js client on flash, communicating with each other by socket. I write stringifyed JSON to socket, and on server read data:
socket.on('data', function(data) {
console.log(JSON.parse(data.toString());
var json = JSON.parse(data.toString()) });
Everything was OK, until I started to send to server JSON with long text messages containing '\n\r'. On that I getting error:
SyntaxError: Unexpected end of input
because '\n\r' means end of the pack. Delete '\n\r' from text isn't the good way cause I need it to show text correctly. Please give me best way to deal with that problem. Thanks in advance.