Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client.on('end', function() {
- console.log('disconnected from server');
- });
- client.on('connect', function() {
- console.log("You have been connected to the server..");
- });
- client.on('data', function(data){
- var meh = data.toString().split('\r\n');
- var parsedMeh = JSON.parse(meh);
- console.log("data: ", meh);
- });
- You have been connected to the server..
- undefined:2
- {"message": " / \\__ ____ _| _ \\ / ___|", "type": "SERVERMOTD"}
- ^
- SyntaxError: Unexpected token {
- at Object.parse (native)
- at Socket.<anonymous> (/media/sda6/Projects/node-proxy/awwjs.js:17:26)
- at Socket.emit (events.js:107:17)
- at readableAddChunk (_stream_readable.js:163:16)
- at Socket.Readable.push (_stream_readable.js:126:10)
- at TCP.onread (net.js:538:20)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement