laverdet / isolated-vm

Secure & isolated JS environments for nodejs
ISC License
2.2k stars 154 forks source link

about Debug on VSCode and use inspector-example.js no response #433

Closed TheWisper closed 10 months ago

TheWisper commented 10 months ago

Hello, what I want to do is debug untrusted Javascript code inside the sandbox, but I can't debug it inside the code

I read some of the official responses and it was, "To debug into the separate isolate, you will need to start a ws server."

But When I use "inspector - example. Js", in the "chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:10000"but nothing happened

laverdet commented 10 months ago

Thanks, the inspector header was out of date for nodejs v20. I'll push the new version to npm a little bit later.

laverdet commented 10 months ago

Oh and the inspector URL moved, it's now just devtools://

TheWisper commented 10 months ago

Thank you so much for updating the code, but when I now click on the devtools link the console prints: Inspector: devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=localhost:10000 test.js:55 {"id":1,"method":"Runtime.enable","params":{}} test.js:35 {"id":2,"method":"Debugger.enable","params":{"maxScriptsCacheSize":10000000}} test.js:35 {"id":3,"method":"Debugger.setPauseOnExceptions","params":{"state":"none"}} test.js:35 Process exited with code 3221225477 I would love to use "isolated-vm" instead of "vm2", but I do have problems with debugging, and there are people like me who have. I would appreciate it very much if you could answer it