Skip to content

HTTP Proxy + Autodiscovery #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions kickstart/etc/dnsmasq-00proxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dhcp-option=252,"http://wpad.{{lan_domain}}/wpad.dat"
2 changes: 1 addition & 1 deletion kickstart/etc/dnsmasq-posm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ dhcp-option=option:ntp-server,0.0.0.0
#dhcp-option=46,8 # netbios node type

# Send an empty WPAD option. This may be REQUIRED to get windows 7 to behave.
dhcp-option=252,"\n"
#dhcp-option=252,"\n"

# Send RFC-3397 DNS domain search DHCP option. WARNING: Your DHCP client
# probably doesn't support this......
Expand Down
2 changes: 1 addition & 1 deletion kickstart/etc/hosts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
127.0.0.1 localhost
{{posm_wlan_ip}} {{posm_fqdn}} {{osm_fqdn}} {{posm_hostname}}.{{lan_domain}} {{posm_hostname}}
{{posm_wlan_ip}} {{posm_fqdn}} {{osm_fqdn}} {{posm_hostname}}.{{lan_domain}} {{posm_hostname}} wpan.{{lan_domain}} wpad
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
5 changes: 5 additions & 0 deletions kickstart/etc/nginx-posm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ server {
location /fp/_/ {
alias /opt/fp/data/;
}

location /wpad.dat {
return 200 'function FindProxyForURL(url, host) {\n if (shExpMatch(host.toLowerCase(), "*.{{posm_fqdn}}") || isInNet(dnsResolve(host), "{{posm_network}}.0.0", "255.240.0.0")) {\n return "DIRECT";\n }\n\n return "PROXY {{posm_wlan_ip}}:1080";\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