add option to enable compression for gRPC-server (#133)

* add grpc server compression

* change compression config defaults

* fix review issue

* add note about compression in readme

* add compression section to server config doc
This commit is contained in:
Vadim Vlasov
2023-02-10 17:27:52 +08:00
committed by GitHub
parent fc36e63ea6
commit 8649cc03aa
7 changed files with 116 additions and 2 deletions

View File

@@ -21,6 +21,12 @@ tls:
client:
require: true
ca: "ca.crt"
compression:
grpc:
server:
enabled: false
cluster:
include: "upstreams.yaml"
----
@@ -29,6 +35,7 @@ It configures following:
- server is listening with gRCP API on `0.0.0.0:2449`
- TLS is enabled
- compression is disabled for gRPC server (enabled by default)
- server certificate is located at `server.crt` with the key for it at `server.p8.key`
- the server requires a client authentication by TLS client certificate signed by `ca.crt` certificate
- no JSON RPC is configured
@@ -51,6 +58,10 @@ a| `tls`
| TLS configuration for gRPC.
See link:08-authentication.adoc[Authentication] for details
a| `compression`
|
| Compression configuration
a| `proxy`
|
| Proxy configuration
@@ -60,6 +71,21 @@ a| `upstreams`
| Upstreams configuration
|===
=== Compression
Compression is enabled by default on the gRPC server
(the server accepts compressed requests and can send compressed responses).
Responses will be compressed if a client supports compression (sends relevant headers),
otherwise, communication will be uncompressed.
But if for some reason you need to disable compression forcibly,
add the lines below to the config:
[source,yaml]
----
compression:
grpc:
client:
enabled: false
----
=== Enabling JSON RPC proxy
In addition to the gRPC protocol, Dshackle provides access compatible with Bitcoin and Ethereum JSON RPC.