I want to debug Graal JS through the Internet in dev tools, similar to the following URL:
devtools://devtools/bundled/js_app.html?ws=mysite.com:4242/aa/bb
But failed
In the line of code [builder.option("inspect", url)], only localhost/LAN IP can succeed, but the Internet domain name and IP cannot succeed.
The following is the test code:
import org.graalvm.polyglot.Context;
public class Test {
public static void main(String[] args) {
var builder = Context.newBuilder();
builder.allowAllAccess(true);
builder.option("js.strict", "true");
builder.option("js.intl-402", "true");
builder.option("js.foreign-object-prototype", "true");
builder.option("inspect", "4242"); // success, but cannot debug via the Internet
builder.option("inspect", "localhost:4242"); // success, but cannot debug via the Internet
builder.option("inspect", "192.168.0.108:4242"); //success, but cannot debug via the Internet
builder.option("inspect", "mysite.com:4242"); //failed, throw "Cannot assign requested address: NET_Bind"
builder.option("inspect", "137.234.110.50:4242"); //failed, use WAN IP, throw "Cannot assign requested address: NET_Bind"
builder.option("inspect.Path", "aa/bb");
builder.option("inspect.Secure", "false");
builder.option("inspect.Suspend", "false");
builder.option("inspect.WaitAttached", "true");
var context = builder.build();
context.eval("js","debugger;let a=3;\nlet b=4;");
context.close();
}
}
Please help.