|
|
Descriptiondo not send traffic to localhost through proxy for android
The proxy config service for android does not allow
one to configure an exception for localhost be made.
The implementation for Linux did allow this in:
proxy_config_service_linux.cc
it just seems it was overlooked for android.
Instead of adding in the ability to configure
localhost as an exclusion, it makes more sense
to just force the exception; it seems silly to
send traffic for localhost through a proxy.
This patch addresses the following bug in android:
https://code.google.com/p/android/issues/detail?id=37031
BUG=
Committed: https://crrev.com/80295948bf0bc43ebb640afd81fa152e9679fd36
Cr-Commit-Position: refs/heads/master@{#308243}
Patch Set 1 #
Total comments: 1
Patch Set 2 : update comment #Patch Set 3 : Adding self to AUTHORS #Messages
Total messages: 33 (7 generated)
torne@chromium.org changed reviewers: + torne@chromium.org
https://codereview.chromium.org/796003002/diff/1/net/proxy/proxy_config_servi... File net/proxy/proxy_config_service_android.cc (right): https://codereview.chromium.org/796003002/diff/1/net/proxy/proxy_config_servi... net/proxy/proxy_config_service_android.cc:104: // proxy_config_service does, just not the android Describing the reason why a change was made doesn't belong in a comment in the actual code; if a comment is needed at all it should explain the state of things *after the change*.
On 2014/12/11 17:44:49, Torne wrote: > https://codereview.chromium.org/796003002/diff/1/net/proxy/proxy_config_servi... > File net/proxy/proxy_config_service_android.cc (right): > > https://codereview.chromium.org/796003002/diff/1/net/proxy/proxy_config_servi... > net/proxy/proxy_config_service_android.cc:104: // proxy_config_service does, > just not the android > Describing the reason why a change was made doesn't belong in a comment in the > actual code; if a comment is needed at all it should explain the state of things > *after the change*. I've changed the comment to be more appropriate.
bma4@zips.uakron.edu changed reviewers: + sgurun@chromium.org
sgurun@chromium.org changed reviewers: + xunjieli@chromium.org
note that I don't see any such bypass rule in _linux.cc file. Please clarify/correct where it is added.
On 2014/12/12 01:05:38, sgurun wrote: > note that I don't see any such bypass rule in _linux.cc file. Please > clarify/correct where it is added. From what I see in the code, a client on Linux could pass "<local>" in the exclusion list which is interpreted as adding localhost.. This would be picked up in the _linux.cc file: bool ProxyConfigServiceLinux::Delegate::GetConfigFromSettings(ProxyConfig* config) When the exclusion list is iterated over later in the function, this may be used to add the rule: proxy_bypass_rules.cc:216 AddRuleFromStringUsingSuffixMatching(*it); Eventually that makes it into: bool ProxyBypassRules::AddRuleFromStringInternal(...) which has the following: // This is the special syntax used by WinInet's bypass list -- we allow it // on all platforms and interpret it the same way. if (LowerCaseEqualsASCII(raw, "<local>")) { AddRuleToBypassLocal(); return true; } The proxy config service on Android does not use the AddRuleFromStringUsingSuffixMatching() call. The call it does use, proxy_config_service_android.cc:120 bypass_rules->AddRuleForHostname(scheme, pattern, -1); does not provide a way for localhost to be added to the exclusion list. As things stand currently, on Android if the proxy is enabled one is unable to use the loopback. One could add the ability to recognize "<local>" to the android proxy config service. However, doing so would require either a change in android to unconditionally add that to the proxy exclusion list, or a user would need to know to configure the device to include "<local>", which seems wrong. Unless there is some use case where proxying localhost makes sense and is desired (I cannot think of one), it seemed reasonable to instead simply refuse to proxy localhost. However, if there is a compelling use case where sending localhost traffic through the proxy is desired, let me know. In that case, what might be the better solution to allow an Android device using chromium to specify localhost to bypass the proxy?
On 2014/12/12 03:24:07, Branden wrote: > On 2014/12/12 01:05:38, sgurun wrote: > > note that I don't see any such bypass rule in _linux.cc file. Please > > clarify/correct where it is added. > > From what I see in the code, a client on Linux could pass "<local>" in the > exclusion list which is interpreted as adding localhost.. This would be picked > up in the _linux.cc file: > > bool ProxyConfigServiceLinux::Delegate::GetConfigFromSettings(ProxyConfig* > config) > > When the exclusion list is iterated over later in the function, this may be used > to add the rule: > > proxy_bypass_rules.cc:216 > AddRuleFromStringUsingSuffixMatching(*it); > > Eventually that makes it into: > > bool ProxyBypassRules::AddRuleFromStringInternal(...) > > which has the following: > > // This is the special syntax used by WinInet's bypass list -- we allow it > // on all platforms and interpret it the same way. > if (LowerCaseEqualsASCII(raw, "<local>")) { > AddRuleToBypassLocal(); > return true; > } > > > The proxy config service on Android does not use the > AddRuleFromStringUsingSuffixMatching() call. The call it does use, > > proxy_config_service_android.cc:120 > bypass_rules->AddRuleForHostname(scheme, pattern, -1); > > does not provide a way for localhost to be added to the exclusion list. As > things stand currently, on Android if the proxy is enabled one is unable to use > the loopback. > > One could add the ability to recognize "<local>" to the android proxy config > service. However, doing so would require either a change in android to > unconditionally add that to the proxy exclusion list, or a user would need to > know to configure the device to include "<local>", which seems wrong. Unless > there is some use case where proxying localhost makes sense and is desired (I > cannot think of one), it seemed reasonable to instead simply refuse to proxy > localhost. > > However, if there is a compelling use case where sending localhost traffic > through the proxy is desired, let me know. In that case, what might be the > better solution to allow an Android device using chromium to specify localhost > to bypass the proxy? your change seems reasonable to me, but I am not a net owner, and I don't think torne is either. I added some net owners as reviewers.
sgurun@chromium.org changed reviewers: + eroman@chromium.org
On 2014/12/12 04:29:50, sgurun wrote: > On 2014/12/12 03:24:07, Branden wrote: > > On 2014/12/12 01:05:38, sgurun wrote: > > > note that I don't see any such bypass rule in _linux.cc file. Please > > > clarify/correct where it is added. > > > > From what I see in the code, a client on Linux could pass "<local>" in the > > exclusion list which is interpreted as adding localhost.. This would be picked > > up in the _linux.cc file: > > > > bool ProxyConfigServiceLinux::Delegate::GetConfigFromSettings(ProxyConfig* > > config) > > > > When the exclusion list is iterated over later in the function, this may be > used > > to add the rule: > > > > proxy_bypass_rules.cc:216 > > AddRuleFromStringUsingSuffixMatching(*it); > > > > Eventually that makes it into: > > > > bool ProxyBypassRules::AddRuleFromStringInternal(...) > > > > which has the following: > > > > // This is the special syntax used by WinInet's bypass list -- we allow it > > // on all platforms and interpret it the same way. > > if (LowerCaseEqualsASCII(raw, "<local>")) { > > AddRuleToBypassLocal(); > > return true; > > } > > > > > > The proxy config service on Android does not use the > > AddRuleFromStringUsingSuffixMatching() call. The call it does use, > > > > proxy_config_service_android.cc:120 > > bypass_rules->AddRuleForHostname(scheme, pattern, -1); > > > > does not provide a way for localhost to be added to the exclusion list. As > > things stand currently, on Android if the proxy is enabled one is unable to > use > > the loopback. > > > > One could add the ability to recognize "<local>" to the android proxy config > > service. However, doing so would require either a change in android to > > unconditionally add that to the proxy exclusion list, or a user would need to > > know to configure the device to include "<local>", which seems wrong. Unless > > there is some use case where proxying localhost makes sense and is desired (I > > cannot think of one), it seemed reasonable to instead simply refuse to proxy > > localhost. > > > > However, if there is a compelling use case where sending localhost traffic > > through the proxy is desired, let me know. In that case, what might be the > > better solution to allow an Android device using chromium to specify localhost > > to bypass the proxy? > > your change seems reasonable to me, but I am not a net owner, and I don't think > torne is either. I added some net owners as reviewers. xunjieli FYI eroman: please review, thanks!
lgtm
On 2014/12/12 23:17:36, eroman wrote: > lgtm Ok thanks eroman. I will go ahead and commit it then.
The CQ bit was checked by sgurun@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/796003002/20001
On 2014/12/12 23:33:09, I haz the power (commit-bot) wrote: > CQ is trying da patch. Follow status at > https://chromium-cq-status.appspot.com/patch-status/796003002/20001 Hello Branden,, There's a presubmit failure. Please see: http://www.chromium.org/developers/contributing-code/external-contributor-che...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
On 2014/12/13 01:01:07, I haz the power (commit-bot) wrote: > Try jobs failed on following builders: > chromium_presubmit on tryserver.chromium.linux > (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) Just to clarify, can you please sign that? thanks https://cla.developers.google.com/about/google-individual?csw=1
On 2014/12/13 01:25:41, sgurun wrote: > On 2014/12/13 01:01:07, I haz the power (commit-bot) wrote: > > Try jobs failed on following builders: > > chromium_presubmit on tryserver.chromium.linux > > > (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) > > Just to clarify, can you please sign that? thanks > > https://cla.developers.google.com/about/google-individual?csw=1 I'm confused. Before I submitted the patch I signed the agreement. Going back to that link and going through the agreement again it says I've already done it once. The presubmit check does say that I am not in the AUTHORS file, but I figured it would be more appropriate if that was done after my change actually went in. (:
On 2014/12/13 02:02:54, Branden wrote: > On 2014/12/13 01:25:41, sgurun wrote: > > On 2014/12/13 01:01:07, I haz the power (commit-bot) wrote: > > > Try jobs failed on following builders: > > > chromium_presubmit on tryserver.chromium.linux > > > > > > (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) > > > > Just to clarify, can you please sign that? thanks > > > > https://cla.developers.google.com/about/google-individual?csw=1 > > I'm confused. Before I submitted the patch I signed the agreement. Going back to > that link and going through the agreement again it says I've already done it > once. > > The presubmit check does say that I am not in the AUTHORS file, but I figured it > would be more appropriate if that was done after my change actually went in. (: sorry for the confusion. Ok I can see that you signed it. We need to add your name to AUTHORS then.
On 2014/12/13 02:05:43, sgurun wrote: > On 2014/12/13 02:02:54, Branden wrote: > > On 2014/12/13 01:25:41, sgurun wrote: > > > On 2014/12/13 01:01:07, I haz the power (commit-bot) wrote: > > > > Try jobs failed on following builders: > > > > chromium_presubmit on tryserver.chromium.linux > > > > > > > > > > (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) > > > > > > Just to clarify, can you please sign that? thanks > > > > > > https://cla.developers.google.com/about/google-individual?csw=1 > > > > I'm confused. Before I submitted the patch I signed the agreement. Going back > to > > that link and going through the agreement again it says I've already done it > > once. > > > > The presubmit check does say that I am not in the AUTHORS file, but I figured > it > > would be more appropriate if that was done after my change actually went in. > (: > > sorry for the confusion. > Ok I can see that you signed it. We need to add your name to AUTHORS then. Is that something I should do (do I have commit access?) or you might be able to help me with?
On 2014/12/13 02:21:08, Branden wrote: > On 2014/12/13 02:05:43, sgurun wrote: > > On 2014/12/13 02:02:54, Branden wrote: > > > On 2014/12/13 01:25:41, sgurun wrote: > > > > On 2014/12/13 01:01:07, I haz the power (commit-bot) wrote: > > > > > Try jobs failed on following builders: > > > > > chromium_presubmit on tryserver.chromium.linux > > > > > > > > > > > > > > > (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) > > > > > > > > Just to clarify, can you please sign that? thanks > > > > > > > > https://cla.developers.google.com/about/google-individual?csw=1 > > > > > > I'm confused. Before I submitted the patch I signed the agreement. Going > back > > to > > > that link and going through the agreement again it says I've already done it > > > once. > > > > > > The presubmit check does say that I am not in the AUTHORS file, but I > figured > > it > > > would be more appropriate if that was done after my change actually went in. > > (: > > > > sorry for the confusion. > > Ok I can see that you signed it. We need to add your name to AUTHORS then. > > Is that something I should do (do I have commit access?) or you might be able to > help me with? My understanding, from http://www.chromium.org/developers/contributing-code/external-contributor-che..., is that you should include a change to AUTHORS file and I can review it. This will not make you a committer, but it will make you an author, so you don't have to do this again later.
On 2014/12/13 02:26:03, sgurun wrote: > On 2014/12/13 02:21:08, Branden wrote: > > On 2014/12/13 02:05:43, sgurun wrote: > > > On 2014/12/13 02:02:54, Branden wrote: > > > > On 2014/12/13 01:25:41, sgurun wrote: > > > > > On 2014/12/13 01:01:07, I haz the power (commit-bot) wrote: > > > > > > Try jobs failed on following builders: > > > > > > chromium_presubmit on tryserver.chromium.linux > > > > > > > > > > > > > > > > > > > > > (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) > > > > > > > > > > Just to clarify, can you please sign that? thanks > > > > > > > > > > https://cla.developers.google.com/about/google-individual?csw=1 > > > > > > > > I'm confused. Before I submitted the patch I signed the agreement. Going > > back > > > to > > > > that link and going through the agreement again it says I've already done > it > > > > once. > > > > > > > > The presubmit check does say that I am not in the AUTHORS file, but I > > figured > > > it > > > > would be more appropriate if that was done after my change actually went > in. > > > (: > > > > > > sorry for the confusion. > > > Ok I can see that you signed it. We need to add your name to AUTHORS then. > > > > Is that something I should do (do I have commit access?) or you might be able > to > > help me with? > > My understanding, from > http://www.chromium.org/developers/contributing-code/external-contributor-che..., > is that you should include a change to AUTHORS file and I can review it. > > This will not make you a committer, but it will make you an author, so you don't > have to do this again later. Ah, got ya. The patch also now includes adding myself to the AUTHORS file.
On 2014/12/13 02:39:23, Branden wrote: > On 2014/12/13 02:26:03, sgurun wrote: > > On 2014/12/13 02:21:08, Branden wrote: > > > On 2014/12/13 02:05:43, sgurun wrote: > > > > On 2014/12/13 02:02:54, Branden wrote: > > > > > On 2014/12/13 01:25:41, sgurun wrote: > > > > > > On 2014/12/13 01:01:07, I haz the power (commit-bot) wrote: > > > > > > > Try jobs failed on following builders: > > > > > > > chromium_presubmit on tryserver.chromium.linux > > > > > > > > > > > > > > > > > > > > > > > > > > > > (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) > > > > > > > > > > > > Just to clarify, can you please sign that? thanks > > > > > > > > > > > > https://cla.developers.google.com/about/google-individual?csw=1 > > > > > > > > > > I'm confused. Before I submitted the patch I signed the agreement. Going > > > back > > > > to > > > > > that link and going through the agreement again it says I've already > done > > it > > > > > once. > > > > > > > > > > The presubmit check does say that I am not in the AUTHORS file, but I > > > figured > > > > it > > > > > would be more appropriate if that was done after my change actually went > > in. > > > > (: > > > > > > > > sorry for the confusion. > > > > Ok I can see that you signed it. We need to add your name to AUTHORS then. > > > > > > Is that something I should do (do I have commit access?) or you might be > able > > to > > > help me with? > > > > My understanding, from > > > http://www.chromium.org/developers/contributing-code/external-contributor-che..., > > is that you should include a change to AUTHORS file and I can review it. > > > > This will not make you a committer, but it will make you an author, so you > don't > > have to do this again later. > > Ah, got ya. The patch also now includes adding myself to the AUTHORS file. AUTHORS lgtm
On 2014/12/13 02:47:30, sgurun wrote: > On 2014/12/13 02:39:23, Branden wrote: > > On 2014/12/13 02:26:03, sgurun wrote: > > > On 2014/12/13 02:21:08, Branden wrote: > > > > On 2014/12/13 02:05:43, sgurun wrote: > > > > > On 2014/12/13 02:02:54, Branden wrote: > > > > > > On 2014/12/13 01:25:41, sgurun wrote: > > > > > > > On 2014/12/13 01:01:07, I haz the power (commit-bot) wrote: > > > > > > > > Try jobs failed on following builders: > > > > > > > > chromium_presubmit on tryserver.chromium.linux > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) > > > > > > > > > > > > > > Just to clarify, can you please sign that? thanks > > > > > > > > > > > > > > https://cla.developers.google.com/about/google-individual?csw=1 > > > > > > > > > > > > I'm confused. Before I submitted the patch I signed the agreement. > Going > > > > back > > > > > to > > > > > > that link and going through the agreement again it says I've already > > done > > > it > > > > > > once. > > > > > > > > > > > > The presubmit check does say that I am not in the AUTHORS file, but I > > > > figured > > > > > it > > > > > > would be more appropriate if that was done after my change actually > went > > > in. > > > > > (: > > > > > > > > > > sorry for the confusion. > > > > > Ok I can see that you signed it. We need to add your name to AUTHORS > then. > > > > > > > > Is that something I should do (do I have commit access?) or you might be > > able > > > to > > > > help me with? > > > > > > My understanding, from > > > > > > http://www.chromium.org/developers/contributing-code/external-contributor-che..., > > > is that you should include a change to AUTHORS file and I can review it. > > > > > > This will not make you a committer, but it will make you an author, so you > > don't > > > have to do this again later. > > > > Ah, got ya. The patch also now includes adding myself to the AUTHORS file. > > AUTHORS lgtm thanks, let's give it a try.
The CQ bit was checked by sgurun@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/796003002/40001
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/80295948bf0bc43ebb640afd81fa152e9679fd36 Cr-Commit-Position: refs/heads/master@{#308243}
Message was sent while issue was closed.
I don't think it's silly to proxy localhost. I'm running a remote testing service, where I manage a bunch of Android devices. My customers want to test their own in-house websites, so I allow them to use Android's proxying feature so that I can proxy my devices through a tunnel to my customers' network. This way, they can test their site using 'localhost', but on my devices, which exist elsewhere. Valid use case, no?
Message was sent while issue was closed.
On 2015/03/18 00:13:25, maj.fil wrote: > I don't think it's silly to proxy localhost. I'm running a remote testing > service, where I manage a bunch of Android devices. My customers want to test > their own in-house websites, so I allow them to use Android's proxying feature > so that I can proxy my devices through a tunnel to my customers' network. This > way, they can test their site using 'localhost', but on my devices, which exist > elsewhere. Valid use case, no? That is a valid use case; did not consider something like that. If that is the case, then the decision to proxy localhost or not needs to be configurable, much like the other platforms that Chromium is used on. If you are interested, maybe log a bug against Chromium for Android for allowing proxying localhost to be configurable?
Message was sent while issue was closed.
On 2015/03/18 01:50:34, Branden wrote: > On 2015/03/18 00:13:25, maj.fil wrote: > > I don't think it's silly to proxy localhost. I'm running a remote testing > > service, where I manage a bunch of Android devices. My customers want to test > > their own in-house websites, so I allow them to use Android's proxying feature > > so that I can proxy my devices through a tunnel to my customers' network. This > > way, they can test their site using 'localhost', but on my devices, which > exist > > elsewhere. Valid use case, no? > > That is a valid use case; did not consider something like that. If that is the > case, then the decision to proxy localhost or not needs to be configurable, much > like the other platforms that Chromium is used on. > > If you are interested, maybe log a bug against Chromium for Android for allowing > proxying localhost to be configurable? Hi, I work with Fil Maj. We'll definitely contribute back so you all are aware of our use case, but I just have a couple of questions first. Does this code refer to a proxy configured in Chrome only, or the proxy that is configured via Android's advanced settings for a particular wifi connection, or some combination thereof? The observed behavior I'm trying to understand. - I can manually configure an S4 in my hand to use a proxy for all web connections, and Chrome 40 respects that -- even for localhost. - But, in our production cloud, when we inject URLs via Appium/Chromedriver to Chrome 40 on an S4, then localhost isn't proxied. It tries to use the regular loopback interface. Could you shed some light on this?
Message was sent while issue was closed.
On 2015/03/18 01:50:34, Branden wrote: > On 2015/03/18 00:13:25, maj.fil wrote: > > I don't think it's silly to proxy localhost. I'm running a remote testing > > service, where I manage a bunch of Android devices. My customers want to test > > their own in-house websites, so I allow them to use Android's proxying feature > > so that I can proxy my devices through a tunnel to my customers' network. This > > way, they can test their site using 'localhost', but on my devices, which > exist > > elsewhere. Valid use case, no? > > That is a valid use case; did not consider something like that. If that is the > case, then the decision to proxy localhost or not needs to be configurable, much > like the other platforms that Chromium is used on. > > If you are interested, maybe log a bug against Chromium for Android for allowing > proxying localhost to be configurable? Bug logged: https://code.google.com/p/chromium/issues/detail?id=471400 |