devtools-core icon indicating copy to clipboard operation
devtools-core copied to clipboard

[Configs] Allow developers to change local ports via tcpPort in the configs/development.json

Open jasonLaster opened this issue 8 years ago • 0 comments

Copying from https://github.com/devtools-html/debugger.html/issues/3203

Please allow developers to modify their listening ports in the configs/development.json, by adding a tcpPort property, so they can use debugger.html for other uses.

One example is by modifying the local ports to enable the debugger.html to listen in on web-ext to debug WebExtensions add-ons.

Currently, the only method to get this to work is by modifying the file, debugger.html/node_modules/devtools-launchpad/bin/firefox-proxy, and then changing the TCP_PORT.

Because the modified code is not supposed to be merged into the master branch, here's the code instead:

const args = minimist(process.argv.slice(2));
const LOCAL_PORT = 6005;  //Modified
const WEB_SOCKET_PORT = args["web-socket-port"] || 9000;
const TCP_PORT = args["tcp-port"] || LOCAL_PORT; //Modified
const shouldStart = args.start;

function start(options) {
  const webSocketPort = options.webSocketPort || 9000;
  const tcpPort = options.tcpPort || LOCAL_PORT; //Modified
  const logging = !!options.logging;
  proxy(webSocketPort, tcpPort, logging);
}

And here it is, as proof of concept to work with web-ext.

jasonLaster avatar Aug 15 '17 18:08 jasonLaster