Skip Menu |

This queue is for tickets about the HTTP-ProxyAutoConfig CPAN distribution.

Report information
The Basics
Id: 114438
Status: open
Priority: 0/
Queue: HTTP-ProxyAutoConfig

People
Owner: Nobody in particular
Requestors: chewi [...] aura-online.co.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.3
Fixed in: (no value)



Subject: Should not do isResolvable check when non-auto proxy variables are explicitly defined
Hello. I'm not a Perl guy, I just want to use sendxmpp from behind a HTTP proxy. The XML::Stream library uses HTTP::ProxyAutoConfig if it is installed, whether you like it or not. It generally is installed because Fedora 23 and CentOS 7 pull it in as a dependency. My environment does have working DNS but HTTP(S) still has to go via a proxy. The problem is that HTTP::ProxyAutoConfig naively assumes that just because the host is resolvable, a proxy isn't required. I gather from Wikipedia that this is how the mechanism has traditionally worked and I don't wish to argue about that but I think this check should only kick in when http_auto_proxy is defined. If http(s)_proxy or ftp_proxy are defined instead then it should always use the proxy unconditionally. This is consistent with other clients such as curl. Please see that patch.
Subject: ProxyAutoConfig.pm.patch
--- ProxyAutoConfig.pm.orig 2016-05-17 10:37:59.736887744 +0100 +++ ProxyAutoConfig.pm 2016-05-17 11:39:59.698789897 +0100 @@ -222,7 +222,6 @@ my $http_host; my $http_port; my $function = "sub FindProxyForURL { my (\$self,\$url,\$host) = \@_; "; - $function .= "if (isResolvable(\$host)) { return \"DIRECT\"; } "; if (exists($ENV{http_proxy})) { ($http_host,$http_port) = ($ENV{"http_proxy"} =~ /^(\S+)\:(\d+)$/); $http_host =~ s/^http\:\/\///;
CC: reatmon [...] mail.com
Subject: Re: [rt.cpan.org #114438] Should not do isResolvable check when non-auto proxy variables are explicitly defined
Date: Tue, 17 May 2016 14:27:34 -0400
To: bug-HTTP-ProxyAutoConfig [...] rt.cpan.org
From: Craig MacKenna <craigm014 [...] gmail.com>
Hello chewi, It has been 6 years since I have had anything to do with perl, proxies, and such. I made certain modifications and enhancement to HTTP::ProxyAutoConfig because 1) like you, I found that it did some things that I didn’t like, and 2) I wanted it to do some additional things. I made no changes to the code you are talking about. I hope that you also sent the following message to Ryan Eatmon (the original author of this module) and that he responds more helpfully than I. But I feel that the change you describe should not be made by simply deleting the one line in your patch. Instead it needs to be something like if (< logic based on $ENV{http_proxy}, $ENV{https_proxy}, $ENV{ftp_proxy}, and/or $ENV{http_auto_proxy} >) { $function.="if(isResolvable(\$host)) {return \"DIRECT\"}"; } If no one else is able to help you, one way to deal with a situation like this is for you to take over the maintenance of the module. Then you can change the functionality as you feel is proper, and deal with any objections to such change(s). If you want to pursue this course, I will try to help accomplish it. Best Regards, Craig MacKenna P.S. It is unfortunate that the Netscape documentation at http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html <http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html> is no longer available at that URL. Show quoted text
> On May 17, 2016, at 7:10 AM, chewi@aura-online.co.uk via RT <bug-HTTP-ProxyAutoConfig@rt.cpan.org> wrote: > > Tue May 17 07:10:22 2016: Request 114438 was acted upon. > Transaction: Ticket created by chewi@aura-online.co.uk > Queue: HTTP-ProxyAutoConfig > Subject: Should not do isResolvable check when non-auto proxy variables > are explicitly defined > Broken in: 0.3 > Severity: Normal > Owner: Nobody > Requestors: chewi@aura-online.co.uk > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=114438 > > > > Hello. I'm not a Perl guy, I just want to use sendxmpp from behind a HTTP proxy. The XML::Stream library uses HTTP::ProxyAutoConfig if it is installed, whether you like it or not. It generally is installed because Fedora 23 and CentOS 7 pull it in as a dependency. > > My environment does have working DNS but HTTP(S) still has to go via a proxy. The problem is that HTTP::ProxyAutoConfig naively assumes that just because the host is resolvable, a proxy isn't required. I gather from Wikipedia that this is how the mechanism has traditionally worked and I don't wish to argue about that but I think this check should only kick in when http_auto_proxy is defined. If http(s)_proxy or ftp_proxy are defined instead then it should always use the proxy unconditionally. This is consistent with other clients such as curl. > > Please see that patch. > --- ProxyAutoConfig.pm.orig 2016-05-17 10:37:59.736887744 +0100 > +++ ProxyAutoConfig.pm 2016-05-17 11:39:59.698789897 +0100 > @@ -222,7 +222,6 @@ > my $http_host; > my $http_port; > my $function = "sub FindProxyForURL { my (\$self,\$url,\$host) = \@_; "; > - $function .= "if (isResolvable(\$host)) { return \"DIRECT\"; } "; > if (exists($ENV{http_proxy})) { > ($http_host,$http_port) = ($ENV{"http_proxy"} =~ /^(\S+)\:(\d+)$/); > $http_host =~ s/^http\:\/\///;
From: chewi [...] aura-online.co.uk
Hi Craig, On Tue May 17 14:27:51 2016, craigm014@gmail.com wrote: Show quoted text
> I hope > that you also sent the following message to Ryan Eatmon (the original > author of this module) and that he responds more helpfully than I.
He is shown as a maintainer under RT so I believe he would have got the message too. Show quoted text
> But I feel that the change you describe should not be made by simply > deleting the one line in your patch. Instead it needs to be something > like > > if (< logic based on $ENV{http_proxy}, $ENV{https_proxy}, > $ENV{ftp_proxy}, and/or $ENV{http_auto_proxy} >) { > $function.="if(isResolvable(\$host)) {return \"DIRECT\"}"; > }
I'm not sure what you think the logic should be but the line I removed is only encountered when http_auto_proxy is unset. If none of the variables are set then it'll just return DIRECT anyway. Show quoted text
> If no one else is able to help you, one way to deal with a situation > like this is for you to take over the maintenance of the module.
Heh, I have my fingers in many open source pies but given that I have sometimes said my unofficial job title is "destroyer of the Perl", I think pigs will fly before I take on a Perl module. ;) I've managed to work around it in a somewhat ugly way by setting RES_OPTIONS=attempts:0, which effectively disables glibc's DNS resolution. I filed the bug anyway because I don't like to rely on such hacks forever and I'd hate to see someone else get stumped over this like I did. Show quoted text
> If you want to pursue this course, > I will try to help accomplish it.
Many thanks all the same. Your message is appreciated as I honestly wasn't expecting one at all. Regards, James