Make http host configurable.
authorMathieu Baudier <mbaudier@argeo.org>
Wed, 24 Aug 2016 15:44:05 +0000 (15:44 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Wed, 24 Aug 2016 15:44:05 +0000 (15:44 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@9086 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

org.argeo.cms/src/org/argeo/cms/internal/kernel/CmsState.java

index 64a9d170bed6b551a49ea6c9a3019a65f6ca93a9..eb57b1b1932fb7fd63f74acdc08b78e0bca77d6e 100644 (file)
@@ -285,6 +285,8 @@ public class CmsState implements NodeState, ManagedService {
        private void initWebServer() {
                String httpPort = getFrameworkProp("org.osgi.service.http.port");
                String httpsPort = getFrameworkProp("org.osgi.service.http.port.secure");
+               /// TODO make it more generic
+               String httpHost = getFrameworkProp("org.eclipse.equinox.http.jetty.http.host");
                try {
                        if (httpPort != null || httpsPort != null) {
                                final Hashtable<String, Object> jettyProps = new Hashtable<String, Object>();
@@ -301,6 +303,9 @@ public class CmsState implements NodeState, ManagedService {
                                        jettyProps.put(JettyConstants.SSL_PASSWORD, "changeit");
                                        jettyProps.put(JettyConstants.SSL_WANTCLIENTAUTH, true);
                                }
+                               if(httpHost!=null){
+                                       jettyProps.put(JettyConstants.HTTP_HOST, httpHost);
+                               }
                                if (configurationAdmin != null) {
                                        // TODO make filter more generic
                                        String filter = "(" + JettyConstants.HTTP_PORT + "=" + httpPort + ")";