diff --git a/extensions/jssh/nsJSShStarter.js b/extensions/jssh/nsJSShStarter.js index a0c1cc2b10b..5d999afe8f1 100644 --- a/extensions/jssh/nsJSShStarter.js +++ b/extensions/jssh/nsJSShStarter.js @@ -130,14 +130,18 @@ JSShStarter.prototype = { // instead of 'createInstance' to get a well-known, globally // accessible instance of a jssh-server. // XXX Todo: get port, startupURI and loopbackOnly from prefs. + + var port = commandline.handleFlagWithParam("jssh-port", false) || 9997; + Components.classes["@mozilla.org/jssh-server;1"] .getService(Components.interfaces.nsIJSShServer) - .startServerSocket(9997, "chrome://jssh/content/jssh-debug.js", true); - debug("JSShStarter: JSSh server started on port 9997\n"); + .startServerSocket(port, "chrome://jssh/content/jssh-debug.js", true); + debug("JSShStarter: JSSh server started on port " + port + "\n"); } }, - helpInfo : " -jssh Start a JSSh server on port 9997.\n", + helpInfo : " -jssh Start a JSSh server on port 9997.\n" + + " -jssh-port Change the JSSh server port.\n", };