Advertisement
Guest User

Untitled

a guest
Jul 31st, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. client.on('end', function() {
  2. console.log('disconnected from server');
  3. });
  4.  
  5. client.on('connect', function() {
  6. console.log("You have been connected to the server..");
  7. });
  8.  
  9. client.on('data', function(data){
  10. var meh = data.toString().split('\r\n');
  11. var parsedMeh = JSON.parse(meh);
  12. console.log("data: ", meh);
  13. });
  14.  
  15.  
  16. You have been connected to the server..
  17. undefined:2
  18. {"message": " / \\__ ____ _| _ \\ / ___|", "type": "SERVERMOTD"}
  19. ^
  20. SyntaxError: Unexpected token {
  21. at Object.parse (native)
  22. at Socket.<anonymous> (/media/sda6/Projects/node-proxy/awwjs.js:17:26)
  23. at Socket.emit (events.js:107:17)
  24. at readableAddChunk (_stream_readable.js:163:16)
  25. at Socket.Readable.push (_stream_readable.js:126:10)
  26. at TCP.onread (net.js:538:20)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement