GrpcWebServerOptions<serviceDefinition>

Options for the RPC server of the gRPC-Web protocol.

Type parameters

Hierarchy

  • GrpcWebServerOptions

Index

Properties

Optional codec

codec: GrpcWebCodec<serviceDefinition>

The Codec to use. By default, we use the GrpcWebJsonCodec codec. The Codec must match the Codec used by the client (this is enforced through content-type negotiation).

Optional reportError

reportError: ReportErrorHandler

A function to report errors that occurred during RPCs.

Optional requestLimit

requestLimit: number | string

Maximum request size. If this is a number, then the value specifies the number of bytes; if it is a string, the value is passed to the bytes library for parsing. Defaults to '100kb'.

Optional router

router: Router

The express router to start from. By default, we start from Router().

Optional useCompression

useCompression: undefined | false | true

Use compression on response bodies. Compression can be disabled as it is a security issue (see https://www.blackhat.com/docs/asia-16/materials/asia-16-Karakostas-Practical-New-Developments-In-The-BREACH-Attack-wp.pdf for a good overview). To mitigate this we recommend, among other things, to use metadata to pass "master" secrets (such as session secrets) around.