/{Service-Name}/{method name}
, for example: /google.pubsub.v2.PublisherService/CreateTopic
. You can use this feature to apply standard ACL rules via Keys and Policies, or use URL rewrite plugins in our Endpoint Desiger.POST
.
gRPC custom request metadata is added as HTTP headers, where metadata key is directly mapped to the HTTP header with the same name.http_server_options.enable_http2
and proxy_enable_http2
to true in your tyk.conf
Gateway config file.listen path
of the Api should be the same as the gRPC service name, so tyk can route it correctly.strip_listen_path
is set to false in your API, so the route of the gRPC service method is build correctly following the standard: {service_name}/{service_method}
.h2c
as protocol in the address of the gRPC server (target_url
) e.g: h2c://my-grpc-server.com
.
flush_interval
, this is required in order to forward data to the downstream target as soon as the upstream target replies. A high flush interval will delay this communication. We recommend the lowest possible value: 1 (1 millisecond). You set this value in your tyk.conf
file in the http_server_options.flush_interval
option.
Authorization
header from your gRPC client.
Basic base64Encode(username:password)
Authorization
header from your gRPC client.
https://grpc.test.example.com:10000
, https://grpc.test.example.com:10001
and so on.h2c://grpc.test.example.com:10000
, h2c://grpc.test.example.com:10001
, etc.
:50051
)strip listen path
in the api/helloworld.Greeter
target_url
. In order for Tyk to detect that you will use h2c
for this API we will need to write the URL with the prefix h2c://
. For this example the URL can be h2c://localhost:50051
grpcurl -plaintext -proto helloworld.proto -d '{"name": "joe"}' tyk-gateway:8080 helloworld.Greeter/SayHello
and you should get as a response: {"message": "Hello joe"}
which means that everything is working as it should.:10000
), the route_guide
application receives a flag to use TLS (go run server.go -tls=true
). It’s exposed in grpc.test.example.com:10000
Strip listen path
in the apityk
/routeguide.RouteGuide
https://grpc.test.example.com:10000
grpcurl -proto route_guide.proto -d '{"latitude": 1, "longitude":2}' tyk:8080 routeguide.RouteGuide/GetFeature
and you should get a successful response. Note that you are not sending the flag -plaintext
as the desire is to connect via HTTPS.:10000
), the route_guide
application receives a flag to enable/disable TLS (go run server.go -tls=false
). It’s available in locahost:10000
"http_server_options.flush_interval": 1
and run the Gateway (for this example will be running it in port 8000).tyk
/routeguide.RouteGuide
. For testing purposes we will use the RouteChat
service as this is a bidirectional service.h2c://localhost:10000
. This way Tyk will communicate with the upstream using h2chttps://tyk.com:8000
.