Merge branch 'master' into lenovo-y480
This commit is contained in:
3860
autoproxy.pac
3860
autoproxy.pac
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
|||||||
HTTP_PROXY="http://192.168.1.13:20172"
|
PROXY_IP="192.168.0.104"
|
||||||
SOCKS_PROXY="socks5://192.168.1.13:20170"
|
HTTP_PROXY="http://${PROXY_IP}:20172"
|
||||||
|
SOCKS_PROXY="socks5://${PROXY_IP}:20170"
|
||||||
|
|
||||||
set-shell-proxy() {
|
set-shell-proxy() {
|
||||||
export http_proxy="$HTTP_PROXY"
|
export http_proxy="$HTTP_PROXY"
|
||||||
|
|||||||
45
dot/.mozilla/autoproxy.pac
Normal file
45
dot/.mozilla/autoproxy.pac
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
/* -*- mode: js; -*- */
|
||||||
|
const proxy_ip = "192.168.0.104"
|
||||||
|
const PROXY = `SOCKS5 ${proxy_ip}:20170; HTTP ${proxy_ip}:20172; DIRECT`;
|
||||||
|
const DIRECT = 'DIRECT';
|
||||||
|
|
||||||
|
const direct_ip_list = [
|
||||||
|
["192.168.0.0", "255.255.255.0"],
|
||||||
|
["192.168.1.0", "255.255.255.0"],
|
||||||
|
["192.168.2.0", "255.255.255.0"],
|
||||||
|
];
|
||||||
|
|
||||||
|
const direct_domain_list = [
|
||||||
|
"zedhugh.fun",
|
||||||
|
"codeberg.org",
|
||||||
|
"gitweb.gentoo.org",
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @params {string} host
|
||||||
|
* @return {boolean}
|
||||||
|
*/
|
||||||
|
const host_should_direct = (host) => {
|
||||||
|
return direct_ip_list.some(([ip, mask]) => {
|
||||||
|
return isInNet(host, ip , mask);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @params {string} host
|
||||||
|
* @return {boolean}
|
||||||
|
*/
|
||||||
|
const domain_should_direct = (host) => {
|
||||||
|
const domains = direct_domain_list.map((domain) => `*${domain}*`);
|
||||||
|
return domains.some((domain) => shExpMatch(host, domain));
|
||||||
|
};
|
||||||
|
|
||||||
|
function FindProxyForURL(url, host) {
|
||||||
|
if (host_should_direct(host) || domain_should_direct(host)) {
|
||||||
|
alert(`DIRECT: ${url}||${host}`);
|
||||||
|
return DIRECT;
|
||||||
|
}
|
||||||
|
|
||||||
|
alert(`PROXY: ${url}||${host}`);
|
||||||
|
return PROXY;
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@ sys-libs/zlib minizip
|
|||||||
sys-devel/gcc lto pgo
|
sys-devel/gcc lto pgo
|
||||||
|
|
||||||
# kernel
|
# kernel
|
||||||
sys-kernel/installkernel dracut grub
|
sys-kernel/installkernel grub
|
||||||
|
|
||||||
# terminal
|
# terminal
|
||||||
x11-terms/xterm sixel xinerama
|
x11-terms/xterm sixel xinerama
|
||||||
|
|||||||
Reference in New Issue
Block a user