Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Header format for V8 debugger

0
0
Hi guys,

so, I can confirm that it is possible to connect with node-inspector by adding a space after the colons in the header transmission message, and providing (very simple) "process" and "global" objects. From the ClearScript point of view, two lines of code need to change in (https://clearscript.codeplex.com/SourceControl/latest#ClearScript/V8/V8DebugAgent.cs):

(1)
SendStringAsync(tcpClient, "Type:connect\r\nV8-Version:" + version + "\r\nProtocol-Version:1\r\nEmbedding-Host:" + name + "\r\nContent-Length:0\r\n\r\n", OnConnectionMessageSent);
becomes
SendStringAsync(tcpClient, "Type:connect\r\nV8-Version: " + version + "\r\nProtocol-Version: 1\r\nEmbedding-Host: " + name + "\r\nContent-Length: 0\r\n\r\n", OnConnectionMessageSent);
and (2)
var headerBytes = Encoding.UTF8.GetBytes(MiscHelpers.FormatInvariant("Content-Length:{0}\r\n\r\n", contentBytes.Length));
becomes
var headerBytes = Encoding.UTF8.GetBytes(MiscHelpers.FormatInvariant("Content-Length: {0}\r\n\r\n", contentBytes.Length));
Unfortunately I have no easy way to test if such changes break the Eclipse debugger (although I think that's unlikely, as the Eclipse debugger already works with node). Let me know if you need more information!

Viewing all articles
Browse latest Browse all 2297