Created
July 1, 2013 19:53
-
-
Save rissem/5903974 to your computer and use it in GitHub Desktop.
minimal node program for talking to a v8 debugger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var net = require("net"); | |
| var socket = net.connect({port: 5858}); | |
| socket.on("data", function(data){ | |
| console.log("received data", data.toString()); | |
| // socket.end(); | |
| }); | |
| socket.on("end", function(data){ | |
| console.log("client disconnected"); | |
| }); | |
| var send = function(msg){ | |
| var json = JSON.stringify(msg); | |
| var data = json + "\n", | |
| header = "Content-Length: " + data.length + "\r\n\r\n", | |
| message = header + data; | |
| console.log("SENDING MSG", data); | |
| socket.write(message); | |
| } | |
| setTimeout(function(){ | |
| send({"seq":223423,"type":"request","command":"evaluate","arguments":{"expression":"process.stdout.write('YOYOYO')", "global":true}}); | |
| }, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment