Posted by invertedlurker in I2P (edited by a moderator )
c00kiepast3 wrote
Reply to comment by pory in How to access .onion sites from I2P? by invertedlurker
I also use PAC Proxy method with this config. I deleted all of my whitelisted domains from the config.
function isYggdrasilIPv6(host) {
host = host.replace(/^\[|\]$/g, "");
var parts = host.split(":");
if (parts.length < 2) return false;
var first16 = parseInt(parts[0], 16);
return first16 >= 0x200 && first16 <= 0x3FF;
}
function FindProxyForURL(url, host) {
if (isYggdrasilIPv6(host)) {
return "DIRECT";
}
if (dnsDomainIs(host, ".i2p")) {
return "SOCKS5 192.168.1.X:4447";
}
if (dnsDomainIs(host, ".onion")) {
return "SOCKS5 192.168.1.X:9050";
}
var whitelist = [
""
];
for (var i = 0; i < whitelist.length; i++) {
var domain = whitelist[i];
if (host === domain || host.endsWith("." + domain)) {
return "DIRECT";
}
}
return "SOCKS5 192.168.1.X:9050";
}
pory wrote
This is much cleaner, thanks!
Viewing a single comment thread. View all comments