Index: Slim/Utils/Prefs.pm =================================================================== --- Slim/Utils/Prefs.pm (revision 13691) +++ Slim/Utils/Prefs.pm (working copy) @@ -161,7 +161,7 @@ 'disabledextensionsplaylist' => '', 'disabledformats' => [], # Server Settings - Networking - 'webproxy' => '', + 'webproxy' => \&defaultWebProxy, 'httpport' => 9000, 'bufferSecs' => 3, 'remotestreamtimeout' => 5, @@ -548,6 +548,25 @@ return $rate; } + +sub defaultWebProxy { + if (Slim::Utils::OSDetect::OS() eq 'unix') { + + my $proxy = $ENV{'http_proxy'}; + my $proxy_port = $ENV{'http_proxy_port'}; + + # remove any leading "http://" + if($proxy) { + $proxy =~ s/http:\/\///i; + $proxy = $proxy . ":" .$proxy_port if($proxy_port); + $log->info("Using environment set proxy to $proxy"); + return $proxy; + } + } else { + return ''; + } +} + 1; __END__