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

Got "gRPC requires HTTP/2" running grpcwebproxy #200

Closed
vintikzzz opened this issue Jun 4, 2018 · 5 comments
Closed

Got "gRPC requires HTTP/2" running grpcwebproxy #200

vintikzzz opened this issue Jun 4, 2018 · 5 comments

Comments

@vintikzzz
Copy link

Hi!
Just want to highlight issue mentioned by @n0mer at #109

Run proxy, everything looks fine

MacBook-Pro:grpcwebproxy vintik$ ./grpcwebproxy --backend_addr=10.105.27.225:4340 --run_tls_server=false
INFO[0000] parsed scheme: ""                             system=system
INFO[0000] scheme "" not registered, fallback to default scheme  system=system
INFO[0000] ccResolverWrapper: sending new addresses to cc: [{10.105.27.225:4340 0  <nil>}]  system=system
INFO[0000] ClientConn switching balancer to "pick_first"  system=system
INFO[0000] pickfirstBalancer: HandleSubConnStateChange: 0xc4200b5400, CONNECTING  system=system
INFO[0000] listening for http on: [::]:8080
INFO[0000] pickfirstBalancer: HandleSubConnStateChange: 0xc4200b5400, READY  system=system

But curl returns gRPC requires HTTP/2

MacBook-Pro:server vintik$ curl 127.0.0.1:8080
gRPC requires HTTP/2

I have to use dep because of #174 and here is it's status:

MacBook-Pro:grpcwebproxy vintik$ dep status
PROJECT                                           CONSTRAINT     VERSION        REVISION  LATEST   PKGS USED
github.com/beorn7/perks                           branch master  branch master  3a771d9   3a771d9  1
github.com/golang/protobuf                        branch master  branch master  3a3da3a   3a3da3a  7
github.com/gorilla/websocket                      v1.2.0         v1.2.0         ea4d1f6   v1.2.0   1
github.com/grpc-ecosystem/go-grpc-middleware      ^1.0.0         v1.0.0         c250d65   v1.0.0   6
github.com/grpc-ecosystem/go-grpc-prometheus      ^1.2.0         v1.2.0         c225b8c   v1.2.0   1
github.com/improbable-eng/grpc-web                ^0.6.2         0.6.2          72eb701   0.6.2    1
github.com/matttproud/golang_protobuf_extensions  v1.0.1         v1.0.1         c12348c   v1.0.1   1
github.com/mwitkow/go-conntrack                   branch master  branch master  cc309e4   cc309e4  2
github.com/mwitkow/grpc-proxy                     branch master  branch master  67591eb   67591eb  1
github.com/prometheus/client_golang               ^0.8.0         v0.8.0         c5b7fcc   v0.8.0   2
github.com/prometheus/client_model                branch master  branch master  99fa1f4   99fa1f4  1
github.com/prometheus/common                      branch master  branch master  7600349   7600349  3
github.com/prometheus/procfs                      branch master  branch master  9466342   9466342  4
github.com/rs/cors                                v1.4.0         v1.4.0         ca016a0   v1.4.0   1
github.com/sirupsen/logrus                        ^1.0.5         v1.0.5         c155da1   v1.0.5   1
github.com/spf13/pflag                            ^1.0.1         v1.0.1         583c0c0   v1.0.1   1
golang.org/x/crypto                               branch master  branch master  df8d471   df8d471  1
golang.org/x/net                                  branch master  branch master  1e49130   1e49130  7
golang.org/x/sys                                  branch master  branch master  c11f84a   c11f84a  2
golang.org/x/text                                 v0.3.0         v0.3.0         f21a4df   v0.3.0   14
google.golang.org/genproto                        branch master  branch master  81158ef   81158ef  1
google.golang.org/grpc                            1.10.1         v1.10.1        61763f5   v1.10.1  23
@met-pub
Copy link
Contributor

met-pub commented Jun 5, 2018

the same

@johanbrandhorst
Copy link
Contributor

I think the issue here is that you're not using the correct headers, so what the gRPC-Web proxy does is just assume your request is a normal gRPC request, and sends it along to the backend gRPC server, which provides this response. If you want to test with cURL, make sure you specify the correct Content-Type header: Content-Type: application/grpc-web+proto.

@natemurthy
Copy link

natemurthy commented Feb 6, 2019

@johanbrandhorst Can we re-open this ticket or #109 ? I'm also observing the same thing in my web browser client using grpcwebproxy-0.6.3 and grpcwebproxy-0.7.0:

screen shot 2019-02-06 at 12 07 55 pm

And when I use curl:

curl -D - http://localhost:9000/Proxy/Ping -H 'Content-Type: application/grpc-web+proto'
HTTP/1.1 500 Internal Server Error
Date: Wed, 06 Feb 2019 20:09:26 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 21
Connection: keep-alive

gRPC requires HTTP/2

@rbautisf
Copy link

Is there any update on this one?

@johanbrandhorst
Copy link
Contributor

This sort of error implies that the wrapper isn't in use, do you have an example code that suffers this?

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

5 participants