Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Lehmann-Mörz2015-09-10 03:09:48 -0400
committerMarco Lehmann-Mörz2015-09-11 00:45:53 -0400
commitc427a225e4c4d85a9bfaadde86e21889a12ee96b (patch)
treec09faabb506795b705acd37164cada6eeb4dbdbf
parentcb2fd92812e176a41c8348ad9f1bdbe3f9c8f74c (diff)
downloadorg.eclipse.hudson.core-c427a225e4c4d85a9bfaadde86e21889a12ee96b.tar.gz
org.eclipse.hudson.core-c427a225e4c4d85a9bfaadde86e21889a12ee96b.tar.xz
org.eclipse.hudson.core-c427a225e4c4d85a9bfaadde86e21889a12ee96b.zip
Fix Bug 407348 - httpListenAddress parameter is not honored
Change-Id: I2dbbc2662b48202a2ac2406ba8d803b3c994e2c6 Signed-off-by: Marco Lehmann-Mörz <mlehmannm@gmail.com>
-rw-r--r--hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java b/hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java
index f54c8c07..abe6a8e5 100644
--- a/hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java
+++ b/hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java
@@ -43,6 +43,9 @@ public class JettyLauncher {
public static void start(String[] args, URL warUrl) throws Exception {
+ String httpListenAddress = "0.0.0.0";
+ String httpsListenAddress = "0.0.0.0";
+
int httpPort = 8080;
int httpsPort = -1;
@@ -56,6 +59,14 @@ public class JettyLauncher {
boolean skipInitSetup = false;
for (int i = 0; i < args.length; i++) {
+ if (args[i].startsWith("--httpListenAddress=")) {
+ httpListenAddress = args[i].substring("--httpListenAddress=".length());
+ }
+
+ if (args[i].startsWith("--httpsListenAddress=")) {
+ httpsListenAddress = args[i].substring("--httpsListenAddress=".length());
+ }
+
if (args[i].startsWith("--httpPort=")) {
String portStr = args[i].substring("--httpPort=".length());
httpPort = Integer.parseInt(portStr);
@@ -108,6 +119,7 @@ public class JettyLauncher {
ServerConnector httpConnector = new ServerConnector(server,
new HttpConnectionFactory(http_config));
+ httpConnector.setHost(httpListenAddress);
httpConnector.setPort(httpPort);
httpConnector.setIdleTimeout(30000);
@@ -135,6 +147,7 @@ public class JettyLauncher {
ServerConnector httpsConnector = new ServerConnector(server,
new SslConnectionFactory(sslContextFactory, "http/1.1"),
new HttpConnectionFactory(https_config));
+ httpsConnector.setHost(httpsListenAddress);
httpsConnector.setPort(httpsPort);
httpsConnector.setIdleTimeout(500000);

Back to the top