GrpcWeb

Converting gRPC Web requests to HTTP/2 gRPC requests.

The GrpcWeb middleware converts gRPC Web requests to HTTP/2 gRPC requests before forwarding them to the backends.

Tip

Please note, that Traefik needs to communicate using gRPC with the backends (h2c or HTTP/2 over TLS). Check out the gRPC user guide for more details.

Configuration Examples

Docker & Swarm

  1. labels:
  2. - "traefik.http.middlewares.test-grpcweb.grpcweb.allowOrigins=*"

Kubernetes

  1. apiVersion: traefik.io/v1alpha1
  2. kind: Middleware
  3. metadata:
  4. name: test-grpcweb
  5. spec:
  6. grpcWeb:
  7. allowOrigins:
  8. - "*"

Consul Catalog

  1. - "traefik.http.middlewares.test-grpcweb.grpcWeb.allowOrigins=*"

File (YAML)

  1. http:
  2. middlewares:
  3. test-grpcweb:
  4. grpcWeb:
  5. allowOrigins:
  6. - "*"

File (TOML)

  1. [http.middlewares]
  2. [http.middlewares.test-grpcweb.grpcWeb]
  3. allowOrigins = ["*"]

Configuration Options

allowOrigins

The allowOrigins contains the list of allowed origins. A wildcard origin * can also be configured to match all requests.

More information including how to use the settings can be found at: