According to CloudFlare documentation, we need Content-Type in the header.
I’m not sure whether grpc-go sends this header field? If not, how to configure it to match this requirement?
$ grpcurl -proto ./pkg/proto/gun.proto -vv my.domain.com:443 GunService/Tun
Resolved method descriptor:
rpc Tun ( stream .Hunk ) returns ( stream .Hunk );
Request metadata to send:
(empty)
Response trailers received:
(empty)
Sent 0 requests and received 0 responses
ERROR:
Code: Unknown
Message: : HTTP status code 521; transport: missing content-type field
What could be the reason?
Another related question: In 2019, I asked whether CloudFlare supports gRPC: gRPC support
I’ll answer this part. Yes, gRPC is now included with all plans.
“gRPC support is available on all Cloudflare plans for no additional fees. However, charges may occur for gRPC traffic over add-on products such as Argo Smart Routing, WAF, and Bot Management.” https://support.cloudflare.com/hc/en-us/articles/360050483011
You can enable/disable gRPC under “Network” in the Cloudflare dashboard.