grpcurl icon indicating copy to clipboard operation
grpcurl copied to clipboard

feat: add support for HTTPS_PROXY

Open denysvitali opened this issue 2 years ago • 6 comments

This commit adds support for the HTTPS_PROXY environment variable. At the moment the NO_PROXY environment variable is ignored, please be aware of that!

This should close #166

On top of that, this adds support for SOCKS_PROXY via the ProxyFromEnvironment method of golang.org/x/net/proxy

denysvitali avatar May 03 '22 13:05 denysvitali

Thanks a lot for the PR! curl is also respecting lowercase https_proxy do you think it make sense to do this here as well?

celloni avatar May 03 '22 13:05 celloni

Hi @denysvitali thanks for the contribution. Is there a reason we'd need a new third party lib instead of using Go's native proxying?

dragonsinth avatar Jun 02 '22 19:06 dragonsinth

can confirm this is working great for us - would love to see it merged 👍

CpuID avatar Jul 05 '22 04:07 CpuID

Hi @denysvitali thanks for the contribution. Is there a reason we'd need a new third party lib instead of using Go's native proxying?

https://github.com/mwitkow/go-http-dialer README explains it:

Some enterprises have fairly restrictive networking environments. They typically operate HTTP forward proxies that require user authentication. These proxies usually allow HTTPS (TCP to :443) to pass through the proxy using the CONNECT method. The CONNECT method is basically a HTTP-negotiated "end-to-end" TCP stream... which is exactly what net.Conn is :)

net/proxy cannot be used here AFAIK because you can't have a dialer that uses TCP over HTTP. The only way to do it is to use a SOCKS5 proxy.

denysvitali avatar Jul 05 '22 08:07 denysvitali

I think I'd be trivially fine with a patch to just change (&net.Dialer{}).DialContext(ctx, network, address) => proxy.Dial(ctx, network, address) which would solve at least some of the cases. But the http dialer stuff seems... very unusual and special case.

dragonsinth avatar Jul 05 '22 17:07 dragonsinth

Release with this patch: https://github.com/L11R/grpcurl/releases/tag/v1.8.8

savely-krasovsky avatar Sep 20 '22 10:09 savely-krasovsky