HTTP::P...toConfig(3)
πΈ NAME πΈ
okay so bestie, this is the HTTP::P...toConfig(3) page from User Contributed Perl Documentation β the module is HTTP::ProxyAutoConfig, and its whole main-character job is: use a .pac or wpad.dat file to get proxy information π
β¨
β¨ SYNOPSIS β¨
like, here's the vibe in code form:
use HTTP::ProxyAutoConfig;
my $pac = HTTP::ProxyAutoConfig->new("http://foo.bar/auto-proxy.pac");
my $pac = new HTTP::ProxyAutoConfig('/Documents and Settings/me/proxy.pac');
my $pac = HTTP::ProxyAutoConfig->new();
my $proxy = $pac->FindProxy('http://www.yahoo.com');
π¦ DESCRIPTION π¦
HTTP::ProxyAutoConfig is literally here for perl scripts that need to access the Internet and wanna know whether they should do it through a proxy server. It uses proxy settings from your IT department β either on the Web or in a browser's .pac file on disk. slay.
It gives you a way to find the proxy server (or the lack of one) for a given URL. If your app has already located a wpad.dat file or a .pac file, HTTP::ProxyAutoConfig processes it to figure out how to handle a particular destination URL. If it is not given a wpad.dat or .pac file, it tests environment variables to determine whether there's a proxy server. no cap.
A wpad.dat or .pac file contains a JavaScript function called FindProxyForURL. This module lets you call that function to learn how to access various URLs. iconic.
Mapping from a URL to the proxy info is provided by a FindProxyForURL(url, host) or FindProxy(url) function call. Both functions return a string that tells your app what to do, namely a direct connection to the Internet or a connection via a proxy server. periodt.
The Proxy Auto Config format and rules were originally developed at Netscape. The Netscape documentation is archived at <http://linuxmafia.com/faq/Web/autoproxy.html>.
More recent references include:
<http://en.wikipedia.org/wiki/Proxy_auto-config><http://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol><http://www.craigjconsulting.com/proxypac.html><http://www.returnproxy.com/proxypac/>
π METHODS π
β¨ new( url_or_file ) β¨
This call creates the FindProxyForURL function and the object through which it can be called. The url_or_file argument is optional, and points to the auto-proxy file provided on your network or a file used by your browser. If there is no argument, HTTP::ProxyAutoConfig will check the http_auto_proxy environment variable, followed by the http_proxy, https_proxy, and ftp_proxy variables. iykyk.
As shown above, you can use either the HTTP::ProxyAutoConfig->new() or the new HTTP::ProxyAutoConfig() form, but do not use the HTTP::ProxyAutoConfig::new() form. that one is not the vibe π«Ά
π FindProxyForURL( url, host ) π
This takes the url, and the host (minus port) from the URL, and determines the action you should take to contact that host. It returns one of three strings:
DIRECT - connect directly
PROXY host:port - connect via the proxy
SOCKS host:port - connect via SOCKS
This result can be used to configure a net-access module like LWP. π
π FindProxy( url ) π
Same as the previous call, except you don't have to extract the host from the URL. easy peasy.
π AUTHORS π
By Ryan Eatmon in May of 2001
0.2 by Craig MacKenna, March 2010
πΈ COPYRIGHT AND LICENSE πΈ
Copyright (C) 2001, Ryan Eatmon
Copyright (C) 2010, Craig MacKenna
This module is free software; you may redistribute it and/or modify it under the same terms as Perl 5.10.1. For more details, see the full text of the licenses at <http://www.perlfoundation.org/artistic_license_1_0> and <http://www.gnu.org/licenses/gpl-2.0.html>.
This program is distributed in the hope that it will be useful, but it is provided 'as is' and without any express or implied warranties. For details, see the full text of the licenses at the above URLs.
and that's the whole page, bestie π«Ά it came from perl v5.32.1, dated 2021-07-22, and the manual title is HTTP::P...toConfig(3) β¨π
π¦ where this page comes from
- epel 9: perl-HTTP-ProxyAutoConfig 0.3-27.el9 Β· GPL+ or Artistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms