Skip to content

Commit

Permalink
Automatic proxy configuration
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mojodna committed May 30, 2016
1 parent 8d0198c commit 1b0a9af
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kickstart/etc/dnsmasq-00proxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dhcp-option=252,wpad.{{lan_domain}}/wpad.dat
cname=wpad,{{posm_fqdn}}
5 changes: 5 additions & 0 deletions kickstart/etc/nginx-posm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ server {
location /fp/_/ {
alias /opt/fp/data/;
}

location /wpad.dat {
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}';
add_header Content-Type application/x-ns-proxy-autoconfig;
}
}

# vim: set sts=2 sw=2 et si nu:
4 changes: 4 additions & 0 deletions kickstart/etc/polipo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
logSyslog = true
logFile = /var/log/polipo/polipo.log
proxyAddress = ::0
proxyPort = 1080
13 changes: 13 additions & 0 deletions kickstart/scripts/proxy-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

deploy_proxy_ubuntu() {
apt-get install --no-install-recommends -y polipo

expand etc/polipo/config /etc/polipo/config
expand etc/dnsmasq-00proxy.conf /etc/dnsmasq.d/00-proxy.conf

service polipo restart
service dnsmasq restart
}

deploy proxy

0 comments on commit 1b0a9af

Please sign in to comment.