mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Use ServerConnector to specify bind IP and idle timeout
This commit is contained in:
parent
cafa94fcba
commit
d12b564ec3
1 changed files with 8 additions and 1 deletions
|
@ -2,6 +2,7 @@ package uk.ac.ic.wlgitbridge.server;
|
||||||
|
|
||||||
import org.eclipse.jetty.server.Handler;
|
import org.eclipse.jetty.server.Handler;
|
||||||
import org.eclipse.jetty.server.Server;
|
import org.eclipse.jetty.server.Server;
|
||||||
|
import org.eclipse.jetty.server.ServerConnector;
|
||||||
import org.eclipse.jetty.server.handler.*;
|
import org.eclipse.jetty.server.handler.*;
|
||||||
import org.eclipse.jetty.servlet.FilterHolder;
|
import org.eclipse.jetty.servlet.FilterHolder;
|
||||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||||
|
@ -71,7 +72,7 @@ public class GitBridgeServer {
|
||||||
swapStore,
|
swapStore,
|
||||||
snapshotApi
|
snapshotApi
|
||||||
);
|
);
|
||||||
jettyServer = new Server(port);
|
jettyServer = new Server();
|
||||||
configureJettyServer(config, repoStore, snapshotApi);
|
configureJettyServer(config, repoStore, snapshotApi);
|
||||||
apiBaseURL = config.getAPIBaseURL();
|
apiBaseURL = config.getAPIBaseURL();
|
||||||
SnapshotAPIRequest.setBaseURL(apiBaseURL);
|
SnapshotAPIRequest.setBaseURL(apiBaseURL);
|
||||||
|
@ -113,6 +114,12 @@ public class GitBridgeServer {
|
||||||
RepoStore repoStore,
|
RepoStore repoStore,
|
||||||
SnapshotApi snapshotApi
|
SnapshotApi snapshotApi
|
||||||
) throws ServletException {
|
) throws ServletException {
|
||||||
|
ServerConnector connector = new ServerConnector(this.jettyServer);
|
||||||
|
connector.setPort(config.getPort());
|
||||||
|
connector.setHost(config.getBindIp());
|
||||||
|
connector.setIdleTimeout(config.getIdleTimeout());
|
||||||
|
this.jettyServer.addConnector(connector);
|
||||||
|
|
||||||
HandlerCollection handlers = new HandlerList();
|
HandlerCollection handlers = new HandlerList();
|
||||||
handlers.addHandler(initApiHandler());
|
handlers.addHandler(initApiHandler());
|
||||||
handlers.addHandler(initBaseHandler());
|
handlers.addHandler(initBaseHandler());
|
||||||
|
|
Loading…
Reference in a new issue