-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
using a socks or http proxy #707
Comments
cc @milesward |
So, I've had to work around haproxy not supporting HTTP/2.0 and requiring that all traffic therefore need be HTTP/1.1 with a The solution I came up with (which is sickening to admit) is using HTTP/1.1 requests and polling with cookies to hold a connection open, and return a net.Conn implementation on top of that for the accept method of the grpc server. I mean, this is insane, and dumb, and no one should do it but I needed things to work /now/. So, yeah, please, no one should have to implement HTTP/2.0 over HTTP/1.1 over TCP/IP. It would be nice if there were a good solution, instead of things like my hack. |
@mischief proxying over |
@mwitkow sure, it could be. however, if go-grpc simply used ProxyFromEnvironment it would be fixed for all users. |
yeah it would be good if grpc supports it by default |
We are adding HTTP CONNECT support in C core (grpc/grpc#7611) and this is a cross-language feature that would benefit all languages. Thus, we believe we should do it in Java (grpc/grpc-java#2193) and Go as well. C will definitely get it first, but we will be trying to schedule this work in for the other languages. We are not planning on SOCKS or similar. Those are much larger beasts than simple HTTP CONNECT. Note that I wouldn't have expected this to be a good solution for haproxy and other server-side proxies, although I guess maybe it could work as a hack. The supported use case is for environments that must connect through a HTTP proxy to access the external world, like many enterprise environments. |
@ejona86 sounds fantastic. my end goal is similar to the enterprise use case, except that i want to run etcd v3 through tor :-) even though tor uses a socks5 proxy natively, i wrote a little program that acts as a http proxy and converts those connections to socks5 proxy requests, so native support in grpc is not strictly necessary - but native support for http proxies in grpc-go is what i want, so all grpc-go programs can benefit from it. ideally, it would be done through |
#1095 should solve it. It implements gRFC A1: grpc/proposal#4 which is the feature @ejona86 mentioned. |
I've just entered this issue because i'm behind socks proxy. How can I define different proxy or remove using proxy for gRPC client? I'm looking for a solution in the code itself, not via setting system environments. |
The proxy is now part of the default dialer. |
@menghanl am i reading the code correctly, does the proxy not support authentication ? For example setting |
@nscavell Right, authorization is currently not supported. #1446 mentioned the same problem. PR #1447 was filed to fix it, but it was not finished. We currently don't have cycles for this now. I proposed a solution in this comment #1447 (comment). So if any one has cycles and wants to send a PR, it will be great. |
how can a socks or http proxy be used with a grpc client?
afaict, it's currently not possible.
it would be great if this was transparent to programs (at least for http proxies) like the default net/http client. in that case, it's simple to make a http proxy to socks bridge.
https://godoc.org/net/http#ProxyFromEnvironment
The text was updated successfully, but these errors were encountered: