Skip to content

Commit c1225c0

Browse files
committed
Automatic proxy configuration
This configures polipo as an HTTP proxy using WPAD (https://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol). I've manually verified that the configuration is correct (and that proxying occurs), however OS X and iOS do not appear to respect these settings.
1 parent 8d0198c commit c1225c0

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

kickstart/etc/dnsmasq-00proxy.conf

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dhcp-option=252,http://wpad.{{lan_domain}}/wpad.dat
2+
cname=wpad,{{posm_fqdn}}

kickstart/etc/nginx-posm.conf

+5
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ server {
7070
location /fp/_/ {
7171
alias /opt/fp/data/;
7272
}
73+
74+
location /wpad.dat {
75+
return 200 'function FindProxyForURL(url, host) {\n if (shExpMatch(host, "{{posm_fqdn}}")) {\n return "DIRECT";\n }\n\n return "PROXY {{posm_wlan_ip}}:1080; DIRECT";\n}';
76+
add_header Content-Type application/x-ns-proxy-autoconfig;
77+
}
7378
}
7479

7580
# vim: set sts=2 sw=2 et si nu:

kickstart/etc/polipo/config

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
logSyslog = true
2+
logFile = /var/log/polipo/polipo.log
3+
proxyAddress = ::0
4+
proxyPort = 1080

kickstart/scripts/proxy-deploy.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
deploy_proxy_ubuntu() {
4+
apt-get install --no-install-recommends -y polipo
5+
6+
expand etc/polipo/config /etc/polipo/config
7+
expand etc/dnsmasq-00proxy.conf /etc/dnsmasq.d/00-proxy.conf
8+
9+
service polipo restart
10+
service dnsmasq restart
11+
}
12+
13+
deploy proxy

0 commit comments

Comments
 (0)