Make http host configurable.
[lgpl/argeo-commons.git] / 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 + ")";