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

Setting proxy parameters is not flexible enough #1446

Closed
denchenko opened this issue Aug 17, 2017 · 5 comments
Closed

Setting proxy parameters is not flexible enough #1446

denchenko opened this issue Aug 17, 2017 · 5 comments
Labels
P3 Type: Feature New features or improvements in behavior

Comments

@denchenko
Copy link

Please answer these questions before submitting your issue.

What version of gRPC are you using?

bfaf042

What version of Go are you using (go version)?

go version go1.8.3 linux/amd64

What operating system (Linux, Windows, …) and version?

Linux

What did you do?

There are multiple grpc connections in my project at one time. One of them need proxy, another not. Proxy require credentials.

What did you see?

Currently, grpc-go takes proxy settings from ENV only once at the start of binary. In addition, it is a little bit buggy. It takes only host and ignores credentials.

What did you expect to see?

I want

  • use credentials with proxy
  • possibility to change proxy in runtime. Since grpc-go takes it only once from env, so it will be enough to add optional parameter ProxyURL. If it is not exist, then use value from ENV
@denchenko
Copy link
Author

I am developing these features and will send PR today.

@EdSchouten
Copy link

It would have made sense if there was a grpc.WithProxy() or something that took a callback that has the same signature as http.ProxyFromEnvironment and http.ProxyURL. For a project of mine (bb-storage) it's a bit wacky that all of the gRPC settings are done through a config file, except for the proxy. That can only be configured through an environment variable.

@dfawley
Copy link
Member

dfawley commented May 3, 2021

For more complex dialing protocols that don't work with our built-in proxy support, we would recommend using the WithContextDialer dial option.

@dfawley dfawley closed this as completed May 3, 2021
@EdSchouten
Copy link

EdSchouten commented Oct 26, 2021

@dfawley If gRPC for Go is not going to provide any more flexible ways for doing this, could source file internal/transport/proxy.go please be released under the public domain? That way people copy-paste all of that code for their purpose. As all of that needs to be duplicated because of it. Thanks!

@dfawley
Copy link
Member

dfawley commented Oct 26, 2021

As part of the CNCF, I believe we are required to keep this license on all code contributed to the project. Note that the terms for the Apache license we use are very flexible, so if you don't want to reimplement it yourself, you can still reuse it directly as long as you follow the requirements.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants