Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unary (grpcweb binary) grpc-web over http3 - no response body #1276

Open
wojciak opened this issue Sep 9, 2022 · 4 comments
Open

unary (grpcweb binary) grpc-web over http3 - no response body #1276

wojciak opened this issue Sep 9, 2022 · 4 comments

Comments

@wojciak
Copy link

wojciak commented Sep 9, 2022

Hi,

I wanted to use h/3 as the transfer protocol, but grpc-web isn't extracting the response body for some reason - normal fetch seems to work.

Did you encounter this sort of issue?

Screenshot 2022-09-09 at 23 19 46

@sampajano
Copy link
Collaborator

Thanks for the question.

Do you mind providing some details on how exactly are you specifying http/3 to be used? thanks :)

@wojciak
Copy link
Author

wojciak commented Sep 12, 2022

Hi,

Sure!

I have an envoy proxy server with a configuration similar to https://baptistout.net/posts/upgrade-envoy-http3/

You can see the request/response headers etc in the below example request
request_headers
response_headers

@wojciak
Copy link
Author

wojciak commented Sep 12, 2022

Hi - I think I can see what the issue is, the response becomes a streaming response on the protocol level, but for an unary request there is no support for partial XMLHttpRequest processing. Using the fetch api here would be much more convenient imho.

Where can I find the grpc-web client (https://www.npmjs.com/package/grpc-web) in an uncompiled/unobscufated form?

I'll try to use grpc-web-text with the streaming interface and report back - but binary streaming would be super nice to have.

@wojciak
Copy link
Author

wojciak commented Sep 12, 2022

Figured it out - the XHR Request being used, doesn't support streaming (d'oh). 2 solutions are possible:

  1. Either set an explicit "Connection: close" header in your envoy proxy (which defeats the idea of streaming req/resp)
  2. Use grpc-web for everything up to request creation, but use your own wrapper for actually making the request (a nice guide on streaming requests can be found here https://developer.chrome.com/articles/fetch-streaming-requests/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants