setting connect host to 0.0.0.0

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

@ -69,7 +69,7 @@ public class YaCyHttpServer {
/**
* @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();
this.server = new Server();
@ -79,7 +79,8 @@ public class YaCyHttpServer {
final HttpConnectionFactory hcf = new HttpConnectionFactory();
final ServerConnector connector = new ServerConnector(this.server, null, null, null, acceptors, -1, hcf);
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.setAcceptQueueSize(128);

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

Loading…
Cancel
Save