1Mojo::UserAgent::Proxy(U3s)er Contributed Perl DocumentatMioojno::UserAgent::Proxy(3)
2
3
4
6 Mojo::UserAgent::Proxy - User agent proxy manager
7
9 use Mojo::UserAgent::Proxy;
10
11 my $proxy = Mojo::UserAgent::Proxy->new;
12 $proxy->detect;
13 say $proxy->http;
14
16 Mojo::UserAgent::Proxy manages proxy servers for Mojo::UserAgent.
17
19 Mojo::UserAgent::Proxy implements the following attributes.
20
21 http
22 my $http = $proxy->http;
23 $proxy = $proxy->http('socks://sri:secret@127.0.0.1:8080');
24
25 Proxy server to use for HTTP and WebSocket requests.
26
27 https
28 my $https = $proxy->https;
29 $proxy = $proxy->https('http://sri:secret@127.0.0.1:8080');
30
31 Proxy server to use for HTTPS and WebSocket requests.
32
33 not
34 my $not = $proxy->not;
35 $proxy = $proxy->not(['localhost', 'intranet.mojolicious.org']);
36
37 Domains that don't require a proxy server to be used.
38
40 Mojo::UserAgent::Proxy inherits all methods from Mojo::Base and
41 implements the following new ones.
42
43 detect
44 $proxy = $proxy->detect;
45
46 Check environment variables "HTTP_PROXY", "http_proxy", "HTTPS_PROXY",
47 "https_proxy", "NO_PROXY" and "no_proxy" for proxy information.
48 Automatic proxy detection can be enabled with the "MOJO_PROXY"
49 environment variable.
50
51 is_needed
52 my $bool = $proxy->is_needed('intranet.example.com');
53
54 Check if request for domain would use a proxy server.
55
56 prepare
57 $proxy->prepare(Mojo::Transaction::HTTP->new);
58
59 Prepare proxy server information for transaction.
60
62 Mojolicious, Mojolicious::Guides, <https://mojolicious.org>.
63
64
65
66perl v5.32.0 2020-07-28 Mojo::UserAgent::Proxy(3)