Skip to content

Commit

Permalink
add more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
riteshvaryani committed Jul 2, 2024
1 parent d1ad10a commit 365e481
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions gateway-ha/gateway-ha-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ requestRouter:
port: 8080
name: prestoRouter
historySize: 1000
requestHeaderSize: 2048000
responseHeaderSize: 2048000
requestBufferSize: 2048000
responseBufferSize: 2048000

dataStore:
jdbcUrl: jdbc:mysql://127.0.0.1:3306/prestogateway
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public ProxyServer provideGateway() {
routerProxyConfig.setKeystorePass(routerConfiguration.getKeystorePass());
routerProxyConfig.setForwardKeystore(routerConfiguration.isForwardKeystore());
routerProxyConfig.setPreserveHost("false");

ProxyHandler proxyHandler = getProxyHandler();
gateway = new ProxyServer(routerProxyConfig, proxyHandler);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ private void setupContext(ProxyServerConfiguration config) {
sslContextFactory.setStopTimeout(TimeUnit.SECONDS.toMillis(15));
sslContextFactory.setSslSessionTimeout((int) TimeUnit.SECONDS.toMillis(15));


if (!TextUtils.isBlank(keystorePath)) {
sslContextFactory.setKeyStorePath(keystoreFile.getAbsolutePath());
sslContextFactory.setKeyStorePassword(keystorePass);
Expand All @@ -68,13 +69,18 @@ private void setupContext(ProxyServerConfiguration config) {
HttpConfiguration httpsConfig = new HttpConfiguration();
httpsConfig.setSecureScheme(HttpScheme.HTTPS.asString());
httpsConfig.setSecurePort(config.getLocalPort());
httpsConfig.setIdleTimeout(150000);
httpsConfig.setOutputBufferSize(32768);
httpsConfig.setRequestHeaderSize(2048000);
httpsConfig.setResponseHeaderSize(2048000);



SecureRequestCustomizer src = new SecureRequestCustomizer();
src.setStsMaxAge(TimeUnit.SECONDS.toSeconds(2000));
src.setStsIncludeSubDomains(true);
httpsConfig.addCustomizer(src);
httpsConfig.addCustomizer( new org.eclipse.jetty.server.ForwardedRequestCustomizer() );
httpsConfig.addCustomizer(new org.eclipse.jetty.server.ForwardedRequestCustomizer());
connector =
new ServerConnector(
server,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ protected HttpClient newHttpClient() {

HttpClient httpClient = new HttpClient(sslFactory);
httpClient.setMaxConnectionsPerDestination(10000);
httpClient.setConnectTimeout(TimeUnit.SECONDS.toMillis(60));
httpClient.setConnectTimeout(TimeUnit.SECONDS.toMillis(65));
httpClient.setIdleTimeout(TimeUnit.SECONDS.toMillis(65));

return httpClient;
}

Expand Down

0 comments on commit 365e481

Please sign in to comment.