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

Why is envoy proxy required? #347

Closed
dv29 opened this issue Oct 29, 2018 · 6 comments
Closed

Why is envoy proxy required? #347

dv29 opened this issue Oct 29, 2018 · 6 comments

Comments

@dv29
Copy link

dv29 commented Oct 29, 2018

If the browser supports http/2, why does grpc-web require a envoy proxy?
is it just for older browser that do not support http/2 or?

Note: quite new to grpc and http/2

@dv29 dv29 changed the title Why is envoy proxy require? Why is envoy proxy required? Oct 29, 2018
@weilip1803
Copy link

weilip1803 commented Oct 30, 2018

I think your question belongs to stackoverflow. And grpc !== http/2 grpc-web leverages on http/2. Hope this article helps. A comparison with grpc will be something like REST and websockets.
https://stackoverflow.com/questions/44877606/is-grpchttp-2-faster-than-rest-with-http-2

Basically grpc and http2 is not the same thats why you need a proxy. If you want the details of the difference you can read the readme below..
https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md
https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md

@stanley-cheung
Copy link
Collaborator

It's a fair question. When you say "browser supports http/2", it is in the context of transparently converting a regular HTTP 1.1 request and "upgrades" the connection to a http/2 one. However, for gRPC-Web to work, we need a lot of the underlying transport to be exposed to us but that's not the case currently cross browsers. We cannot leverage the full http2 protocol given the current set of browser APIs.

@dv29
Copy link
Author

dv29 commented Oct 30, 2018

@weilip1803 thanks for those resources. I understand grpc is not http/2
@stanley-cheung thanks for that quick reply, thats what I was looking for. So in future when browsers have full htt2 protocol, will that eliminate the requirement for the proxy, correct?

@srini100
Copy link
Contributor

@dv29, it is not that browsers don't have full http2 protocol, rather it is how much of the http2 transport is exposed to the application. For example, gRPC relies on trailing headers but browsers don't expose those.

@dv29
Copy link
Author

dv29 commented Nov 1, 2018

@srini100 Got it, do you have any document reference that I can read maybe?

@srini100
Copy link
Contributor

srini100 commented Nov 1, 2018

I found this to be useful to understand the wire format differences. As you can see, the proxy is essentially needed to convert between grpc-web and native protocol.

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

No branches or pull requests

4 participants