Skip to content

Commit 8f58414

Browse files
committed
[breaking] servers - tomcat webserver constructor should now take a bind interface into consideration, defaulted to 0.0.0.0
1 parent ad67870 commit 8f58414

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

restx-server-tomcat/src/main/java/restx/server/TomcatWebServer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public class TomcatWebServer extends WebServerBase {
2222
private final Tomcat tomcat;
2323
private final Context context;
2424

25-
public TomcatWebServer(String appBase, int port) throws ServletException {
26-
super(checkNotNull(appBase), port, "localhost", "Apache Tomcat", "org.apache.tomcat", "tomcat-catalina");
25+
public TomcatWebServer(String appBase, int port, String bindInterface) throws ServletException {
26+
super(checkNotNull(appBase), port, bindInterface, "Apache Tomcat", "org.apache.tomcat", "tomcat-catalina");
2727

2828
tomcat = new Tomcat();
2929

@@ -58,12 +58,12 @@ protected void _stop() throws LifecycleException {
5858
tomcat.stop();
5959
}
6060

61-
public static WebServerSupplier tomcatWebServerSupplier(final String appBase) {
61+
public static WebServerSupplier tomcatWebServerSupplier(final String appBase, final String bindInterface) {
6262
return new WebServerSupplier() {
6363
@Override
6464
public WebServer newWebServer(int port) {
6565
try {
66-
return new TomcatWebServer(appBase, port);
66+
return new TomcatWebServer(appBase, port, bindInterface);
6767
} catch (ServletException e) {
6868
throw Throwables.propagate(e);
6969
}

restx-server-tomcat/src/main/java/restx/server/TomcatWebServerModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ public String restxServerTomcatAppBaseDefaultLocation() {
2020
@Provides
2121
@Named("restx.server.tomcat")
2222
public WebServerSupplier tomcatWebServerSupplier(@Named("restx.server.tomcat.appbase.default.location") String appBase){
23-
return TomcatWebServer.tomcatWebServerSupplier(appBase);
23+
return TomcatWebServer.tomcatWebServerSupplier(appBase, "0.0.0.0");
2424
}
2525
}

0 commit comments

Comments
 (0)