[HTTP Proxy] Support CIDR blocks in no_proxy config#31119
[HTTP Proxy] Support CIDR blocks in no_proxy config#31119yashykt merged 5 commits intogrpc:masterfrom
no_proxy config#31119Conversation
1151d0e to
80cd1a3
Compare
| return false; | ||
| } | ||
|
|
||
| auto proxy_address = StringToSockaddr(cidr[0], 0); |
There was a problem hiding this comment.
We may want to parse port numbers for exact IP matches, but this should be done outside of the CIDR comparison. Golang does this: https://github.com/golang/go/blob/f771edd7f92a47c276d65fbd9619e16a786c6746/src/vendor/golang.org/x/net/http/httpproxy/proxy.go#L38-L50
4e45501 to
07d303b
Compare
07d303b to
bb1b3a4
Compare
|
@yashykt Would you be able to review? |
|
Sorry for the delay. I'll take a look at this this week. |
f0b631b to
708a168
Compare
This commit adds support for using CIDR blocks defined in the `no_proxy` environment variable. For example: ``` http_proxy=http://localhost:8080 no_proxy=10.10.0.0/24 ``` The example above would bypass the proxy if the server IP matched 10.10.0.0 - 10.10.0.255. Closes grpc#22681
yashykt
left a comment
There was a problem hiding this comment.
Also, could I request that you do not force-push/delete older commits that were reviewed. It would help maintain review history. The commits would be squashed at merge time anyway.
708a168 to
051e7d6
Compare
Sure, thing. I'm curious, though, how it maintains review history. The pull request still has the comments? |
If the previous commits remain, I can do a diff and see what changed from the previous commit, as opposed to having to look at the entire PR again. |
|
Trying to reproduce this build failure. Am I just missing this? diff --cc BUILD
index 4ec32ff966,4ec32ff966..9159917f7c
--- a/BUILD
+++ b/BUILD
@@@ -2756,10 -2756,10 +2756,12 @@@ grpc_cc_library
"//src/core:ext/filters/client_channel/lb_policy/child_policy_handler.cc",
"//src/core:ext/filters/client_channel/lb_policy/oob_backend_metric.cc",
"//src/core:ext/filters/client_channel/local_subchannel_pool.cc",
++ "//src/core:ext/filters/client_channel/parse_address.cc",
"//src/core:ext/filters/client_channel/retry_filter.cc",
"//src/core:ext/filters/client_channel/retry_service_config.cc",
"//src/core:ext/filters/client_channel/retry_throttle.cc",
"//src/core:ext/filters/client_channel/service_config_channel_arg_filter.cc",
++ "//src/core:ext/filters/client_channel/sockaddr_utils.cc",
"//src/core:ext/filters/client_channel/subchannel.cc",
"//src/core:ext/filters/client_channel/subchannel_pool_interface.cc",
"//src/core:ext/filters/client_channel/subchannel_stream_client.cc",
@@@ -2782,9 -2782,9 +2784,11 @@@
"//src/core:ext/filters/client_channel/lb_policy/oob_backend_metric.h",
"//src/core:ext/filters/client_channel/lb_policy/oob_backend_metric_internal.h",
"//src/core:ext/filters/client_channel/local_subchannel_pool.h",
++ "//src/core:ext/filters/client_channel/parse_address.h",
"//src/core:ext/filters/client_channel/retry_filter.h",
"//src/core:ext/filters/client_channel/retry_service_config.h",
"//src/core:ext/filters/client_channel/retry_throttle.h",
++ "//src/core:ext/filters/client_channel/sockaddr_utils.h",
"//src/core:ext/filters/client_channel/subchannel.h",
"//src/core:ext/filters/client_channel/subchannel_interface_internal.h",
"//src/core:ext/filters/client_channel/subchannel_pool_interface.h", |
01f193d to
6aeb5b1
Compare
|
oops, looks like I overwrote your commit. My bad! But, I think that should fix the build issues. |
|
Thanks! I wasn't able to reproduce the error locally with |
|
@stanhu can you please run - |
|
@yashykt I think I did it; I found it odd that it appeared that the diffs changed between each script. |
no_proxy configno_proxy config
|
Thanks for the contribution! |
This commit adds support for using CIDR blocks defined in the `no_proxy` environment variable. For example: ``` http_proxy=http://localhost:8080 no_proxy=10.10.0.0/24 ``` The example above would bypass the proxy if the server IP matched 10.10.0.0 - 10.10.0.255. Closes grpc#22681 --------- Co-authored-by: Yash Tibrewal <yashkt@google.com>
This commit adds support for using CIDR blocks defined in the `no_proxy` environment variable. For example: ``` http_proxy=http://localhost:8080 no_proxy=10.10.0.0/24 ``` The example above would bypass the proxy if the server IP matched 10.10.0.0 - 10.10.0.255. Closes #22681 --------- Co-authored-by: Yash Tibrewal <yashkt@google.com>
This commit adds support for using CIDR blocks defined in the
no_proxyenvironment variable. For example:The example above would bypass the proxy if the server IP matched 10.10.0.0 - 10.10.0.255.
Closes #22681