setting connect host to 0.0.0.0

pull/584/head
Michael Christen 2 years ago
parent 1c0f50985c
commit a348146d8f

@ -69,7 +69,7 @@ public class YaCyHttpServer {
/** /**
* @param port TCP Port to listen for http requests * @param port TCP Port to listen for http requests
*/ */
public YaCyHttpServer(final int port) { public YaCyHttpServer(final int port, String host) {
final Switchboard sb = Switchboard.getSwitchboard(); final Switchboard sb = Switchboard.getSwitchboard();
this.server = new Server(); this.server = new Server();
@ -79,7 +79,8 @@ public class YaCyHttpServer {
final HttpConnectionFactory hcf = new HttpConnectionFactory(); final HttpConnectionFactory hcf = new HttpConnectionFactory();
final ServerConnector connector = new ServerConnector(this.server, null, null, null, acceptors, -1, hcf); final ServerConnector connector = new ServerConnector(this.server, null, null, null, acceptors, -1, hcf);
connector.setPort(port); connector.setPort(port);
connector.setName("httpd:"+Integer.toString(port)); connector.setHost(host);
connector.setName("httpd-" + host + ":" + Integer.toString(port));
connector.setIdleTimeout(9000); // timout in ms when no bytes send / received connector.setIdleTimeout(9000); // timout in ms when no bytes send / received
connector.setAcceptQueueSize(128); connector.setAcceptQueueSize(128);

@ -298,7 +298,7 @@ public final class yacy {
try { try {
// start http server // start http server
YaCyHttpServer httpServer; YaCyHttpServer httpServer;
httpServer = new YaCyHttpServer(port); httpServer = new YaCyHttpServer(port, "0.0.0.0");
httpServer.startupServer(); httpServer.startupServer();
sb.setHttpServer(httpServer); sb.setHttpServer(httpServer);
// TODO: this has no effect on Jetty (but needed to reflect configured value and limit is still used) // TODO: this has no effect on Jetty (but needed to reflect configured value and limit is still used)

Loading…
Cancel
Save