mirror of https://github.com/grpc/grpc-node.git
889 B
889 B
Compression
Client side
The preferred method for configuring message compression on a client is to pass options when the client object is instantiated.
The two options need to be passed:
grpc.default_compression_algorithm (integer)
The option keeps the value of a compression algorithm.
Possible values for this option are:
0- No compression1- Compress with DEFLATE algorithm2- Compress with GZIP algorithm3- Stream compression with GZIP algorithm
grpc.default_compression_level (integer)
The option keeps the value for the level of compression.
Possible values for this option are:
0- None1- Low level2- Medium level3- High level
Code example
client = new ExampleClient("example.com", credentials.createInsecure(), {'grpc.default_compression_algorithm': 2, 'grpc.default_compression_level': 2});