我使用 HTTP::ProxyPAC 模块从 pac 文件中获取代理。但我得到了错误
“JavaScript 模块和 JS 模块似乎都不可用”
请让我知道如何进行。这是我的代码
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::ProxyPAC;
my $ua = LWP::UserAgent->new( keep_alive => 1);
my $pac = HTTP::ProxyPAC->new( URI->new ("http://pacfilelocation:8080/pac_file.pac") );
my $res = $pac->find_proxy("https://www.google.com");
if ($res->direct) {
print "No Proxy Needed\n";
} elsif ($res->proxy) {
print "Proxy is: " . $res->proxy . "\n";
$ENV{HTTPS_PROXY} = $res->proxy;
$ENV{HTTP_PROXY} = $res->proxy;
$ua->env_proxy;
}