Do grpc c++ clients support proxies?

20 views
Skip to first unread message

Stephan Menzel

unread,
Aug 27, 2019, 3:56:23 AM8/27/19
to grpc.io
Hello all,

I am using several c++ client implementations for grpc services and I would like to enable them to go through proxies. Ideally SOCKS5 but http would be acceptable as well. Now my question is, does grpc support this out of the box?

This is how I instantiate the client:

m_stub = MyService::NewStub(grpc::CreateChannel(hostname, grpc::InsecureChannelCredentials()));

Pretty straight forward, on grpc 1.21.4 right now. Can I just give any parameter of sorts to enable this?

In case not, are there any experiences as to how to make that work?

Cheers,
Stephan

Stephan Menzel

unread,
Aug 27, 2019, 6:52:32 AM8/27/19
to grpc.io
Hello once again,

Am Dienstag, 27. August 2019 09:56:23 UTC+2 schrieb Stephan Menzel:
Hello all,

I am using several c++ client implementations for grpc services and I would like to enable them to go through proxies. Ideally SOCKS5 but http would be acceptable as well. Now my question is, does grpc support this out of the box?


digging through the source I believe I've figured out at least one way.

If I set an environment variable like this: http_proxy="http://127.0.0.1:8118"

... gRPC appears to honor it and send the requests through the proxy. Good start. Still, SOCKS5? My application will require it anyway and I'd like to use one proxy for everything.

Cheers,
Stephan 
Reply all
Reply to author
Forward
0 new messages