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\:\/\///;