-
Notifications
You must be signed in to change notification settings - Fork 18k
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
net/http/httputil: ReverseProxy doesn't proxy grpc without help due to 'te' header handling #21096
Comments
I bet it doesn't like the But that would have nothing to do with Go's HTTP/2 support. |
Here is the debug output of the proxy version:
proxying to the ruby grpc greeter server.
|
And this is what happens when the remote is a grpc-go server:
|
Here's something. I figured out how to enable http tracing on the ruby server:
|
It's missing the "te" header. The https://grpc.io/docs/guides/wire.html does say:
I guess you're an incompatible proxy! :-) I forget which layer's job it is to strip/add/handle that. But that's what should be investigated here. /cc @tombergan |
Yep, commenting out go/src/net/http/httputil/reverseproxy.go Line 135 in 3498012
Doesn't sound like the right solution for a proxy to keep that header though. Should I open a issue with grpc/grpc? |
Found this article from the nginx blog https://nghttp2.org/blog/2015/03/24/proxying-grpc-with-nghttpx/
|
@bradfitz is it too late in the 1.9 cycle or would you accept a CL to update this behavior in httputil/reverseproxy.go? Something like this is what I had in mind:
|
It's way too late. But your proxy can add those lines. It's not obvious that we want to add application-specific hacks to reverseproxy.go. Let's think about it during Go 1.10 development. |
Pushing to Go 1.11. @tombergan, do you know what's right here? |
Change https://golang.org/cl/115135 mentions this issue: |
@gopherbot I've tested the go1.11beta2, the "Te" header in the client still missing when request backend server, I'm using traefik. Thanks. |
@Cas-pian, you probably didn't recompile your application or didn't do so with the right version of Go. |
@bradfitz Thanks for your reply. I've recompile my application. And I found the application didn't use your function. I've fixed it. Thanks again! |
I have the same problem but cant find a solution:
If I make a call from gnmi server to client, I get:
|
Pass "Te" trailer. See golang/go#21096
Pass "Te" trailer. See golang/go#21096
Pass "Te" trailer. See golang/go#21096 This PR adds gRPC test. Fixes #2105
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?Go 1.8.3 (but can reproduce with 1.9beta2.
What operating system and processor architecture are you using (
go env
)?darwin and linux
What did you do?
Tried to use the http2 transport to talk to a remote http2 server.
https://play.golang.org/p/W_HbQGJZK9
The server on the other end is the grpc helloworld example.
When running against the grpc-go implementation, the code works.
When running agains ruby or python(both backed by C code) I get the INTERNAL_ERROR response described above. Logging on the server side itself is silent.
Note, the HTTP POST is only to more easily reproduce the issue. What I'm trying to do instead is use httputil.ReverseProxy to proxy grpc traffic: https://play.golang.org/p/micZul79Ow
This succeeds if the upstream server is in Go
C server examples: https://github.com/grpc/grpc/tree/master/examples (connecting to these fails)
grpc-go examples: https://github.com/grpc/grpc-go/tree/master/examples (connecting to this server succeeds)
What did you expect to see?
An HTTP response.
What did you see instead?
The text was updated successfully, but these errors were encountered: