]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/outbound_proxy.mdwn
ikiwiki (3.20140916) unstable; urgency=low
[ikiwiki.git] / doc / todo / outbound_proxy.mdwn
1 [[!template id=gitbranch branch=schmonz/proxy author="[[schmonz]]"]]
2 [[!tag patch]]
3
4 ## Background
5
6 Ikiwiki has several plugins that open outbound connections:
7
8 * [[plugins/aggregate]]
9 * [[plugins/openid]]
10 * [[plugins/pinger]]
11
12 In some networks it is desired (or necessary) for these connections
13 to traverse a proxy. Proxies are usually configured via environment
14 variables, so for ikiwiki it is probably not desirable (or necessary)
15 to manage proxy configuration via new purpose-specific settings in
16 the setup file; `ENV` ought to suffice.
17
18 [[!cpan LWP::UserAgent]] by default doesn't care about the usual
19 environment variables, but if its constructor is passed a true
20 `env_proxy` value, it does. Then environment settings such as these
21 influence the agent, as expected:
22
23     ENV:
24       http_proxy: 'http://foo.internal:8080'
25       no_proxy: 'localhost,.bar.internal'
26
27 If the proxy and/or destination requires authentication, it may
28 also be necessary to prime `cookiejar`.
29
30 ## Changes
31
32 This patch causes ikiwiki's `LWP::UserAgent` instances to:
33
34 * honor proxy configuration in the environment
35 * consistently make use of cookies configured in the setup file
36
37 ## Limitations
38
39 The patch lets me configure [[plugins/aggregate]] to traverse my
40 corporate proxy and to skip the proxy for internal hosts. I haven't
41 tested it with the other two plugins, both of which prefer [[!cpan
42 LWPx::ParanoidAgent]] if present, which deliberately lacks proxy
43 support. There exists [[!cpan LWP::UserAgent::Paranoid]] claiming
44 to be more modern, but I haven't looked at it further, so I don't
45 know whether its paranoia measures up or whether it supports proxies.
46
47 ## See also
48
49 * [[bugs/http_proxy_for_openid]]
50 * [[forum/Setting_http__95__proxy]]
51
52 > This looks fine, but you forgot to move the config entry for cookiejar
53 > from aggregate to the config setting list in IkiWiki.pm --[[Joey]] 
54
55 >> Indeed, fixed. --[[schmonz]]
56
57 >>> [[merged|done]] --[[Joey]]