Skip to content

Instantly share code, notes, and snippets.

@Kubuxu
Created June 25, 2015 12:26
Show Gist options
  • Save Kubuxu/768735a1c39ce0f5ec03 to your computer and use it in GitHub Desktop.
Save Kubuxu/768735a1c39ce0f5ec03 to your computer and use it in GitHub Desktop.
PAC file for cjdns proxy
function FindProxyForURL(url, host) {
// If we can't resolve this means that this host is IPv4 only. Trying cjdns won't hurt.
// It also make IPv4 only hosts connect ot clearnet IPv6 hosts if proxy is IPv6 capable.
// If we can resolve check if the host is insice cjdns network space.
if (shExpMatch(host, "fc*:*") || !dnsResolve(host) || shExpMatch(dnsResolve(host), "fc*:*")) {
return "SOCKS5 localhost:8080";
}
return "DIRECT";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment