Use Http Compression (#1884)

Where vertx allows turn on gzip compression for HTTP.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
pull/1886/head
Danno Ferrin 4 years ago committed by GitHub
parent a75e87ab2d
commit a30d8accb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/GraphQLHttpService.java
  2. 3
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpService.java
  3. 6
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketService.java
  4. 6
      metrics/core/src/main/java/org/hyperledger/besu/metrics/prometheus/MetricsHttpService.java

@ -129,7 +129,11 @@ public class GraphQLHttpService {
// Create the HTTP server and a router object. // Create the HTTP server and a router object.
httpServer = httpServer =
vertx.createHttpServer( vertx.createHttpServer(
new HttpServerOptions().setHost(config.getHost()).setPort(config.getPort())); new HttpServerOptions()
.setHost(config.getHost())
.setPort(config.getPort())
.setHandle100ContinueAutomatically(true)
.setCompressionSupported(true));
// Handle graphql http requests // Handle graphql http requests
final Router router = Router.router(vertx); final Router router = Router.router(vertx);

@ -340,7 +340,8 @@ public class JsonRpcHttpService {
new HttpServerOptions() new HttpServerOptions()
.setHost(config.getHost()) .setHost(config.getHost())
.setPort(config.getPort()) .setPort(config.getPort())
.setHandle100ContinueAutomatically(true); .setHandle100ContinueAutomatically(true)
.setCompressionSupported(true);
applyTlsConfig(httpServerOptions); applyTlsConfig(httpServerOptions);
return httpServerOptions; return httpServerOptions;

@ -91,8 +91,10 @@ public class WebSocketService {
new HttpServerOptions() new HttpServerOptions()
.setHost(configuration.getHost()) .setHost(configuration.getHost())
.setPort(configuration.getPort()) .setPort(configuration.getPort())
.setWebsocketSubProtocols("undefined")) .setHandle100ContinueAutomatically(true)
.websocketHandler(websocketHandler()) .setCompressionSupported(true)
.addWebSocketSubProtocol("undefined"))
.webSocketHandler(websocketHandler())
.requestHandler(httpHandler()) .requestHandler(httpHandler())
.listen(startHandler(resultFuture)); .listen(startHandler(resultFuture));

@ -81,7 +81,11 @@ public class MetricsHttpService implements MetricsService {
// Create the HTTP server and a router object. // Create the HTTP server and a router object.
httpServer = httpServer =
vertx.createHttpServer( vertx.createHttpServer(
new HttpServerOptions().setHost(config.getHost()).setPort(config.getPort())); new HttpServerOptions()
.setHost(config.getHost())
.setPort(config.getPort())
.setHandle100ContinueAutomatically(true)
.setCompressionSupported(true));
final Router router = Router.router(vertx); final Router router = Router.router(vertx);

Loading…
Cancel
Save