4

I have a server in go using gRPC and on the react client I'm using grpc web with grpcwebproxy and I've been trying to connect my client to the server but constantly get error Code 2, with the message: Response closed without headers. Has anybody else encountered this issue? I'm currently using improbable-eng implementation of grpc-web.

kpuno
  • 41
  • 1
  • 4
  • I had this issue and and was able to get it working. Can you provide some code where your client calls the proxy? – brietsparks Nov 16 '19 at 07:37

2 Answers2

2

grpcwebproxy: might have read/write timeout and close your longPolling connection by timeout. Relevant for all client-server streaming calls.
server_http_max_read_timeout – HTTP server config, max read duration (default 10s).
server_http_max_write_timeout – HTTP server config, max write duration (default 10s).

am0wa
  • 7,724
  • 3
  • 38
  • 33
  • This was my culprit. I have a long-running scraper grabbing information every hour or so. And I've never had issues with CORS on the endpoint. It only pops up very rarely and usually after weeks of uptime – bbuck May 02 '23 at 17:09
1

You probably need to configure grpcwebproxy for CORS, see this docs.

jano
  • 735
  • 7
  • 20