Add Facebook and Twitter special proxy server

This commit is contained in:
ValdikSS 2022-03-07 14:15:39 +03:00
parent 041774a1dc
commit f96c42ba84
2 changed files with 16 additions and 4 deletions

View File

@ -6,6 +6,9 @@ PACHTTPSHOST='proxy-ssl.antizapret.prostovpn.org:3143'
# Regular proxy address # Regular proxy address
PACPROXYHOST='proxy-nossl.antizapret.prostovpn.org:29976' PACPROXYHOST='proxy-nossl.antizapret.prostovpn.org:29976'
# Facebook and Twitter proxy address
PACFBTWHOST='proxy-fbtw-ssl.antizapret.prostovpn.org:3143'
PACFILE="result/proxy-host-ssl.pac" PACFILE="result/proxy-host-ssl.pac"
PACFILE_NOSSL="result/proxy-host-nossl.pac" PACFILE_NOSSL="result/proxy-host-nossl.pac"

View File

@ -73,8 +73,18 @@ echo " if (domains.length < 10) return \"DIRECT\"; // list is broken
shost = host.replace(/(.+)\.([^.]+\.[^.]+$)/, \"\$2\"); shost = host.replace(/(.+)\.([^.]+\.[^.]+$)/, \"\$2\");
// remove leading www // remove leading www
shost = shost.replace(/^www\.(.+)/, \"\$1\"); shost = shost.replace(/^www\.(.+)/, \"\$1\");" >> "$PACFILE"
cp "$PACFILE" "$PACFILE_NOSSL"
echo "
fbtw = ['twitter.com', 'twimg.com', 't.co',
'facebook.com', 'fbcdn.net'];
if (fbtw.indexOf(shost) !== -1) {
return \"HTTPS ${PACFBTWHOST}; PROXY ${PACPROXYHOST}; DIRECT\";
}" >> "$PACFILE"
echo "
var curdomain = shost.match(/(.*)\\.([^.]+\$)/); var curdomain = shost.match(/(.*)\\.([^.]+\$)/);
if (!curdomain || !curdomain[2]) {return \"DIRECT\";} if (!curdomain || !curdomain[2]) {return \"DIRECT\";}
var curhost = curdomain[1]; var curhost = curdomain[1];
@ -109,9 +119,8 @@ echo " if (domains.length < 10) return \"DIRECT\"; // list is broken
// WARNING! WARNING! WARNING! // WARNING! WARNING! WARNING!
// You should NOT use these proxy servers outside of PAC file! // You should NOT use these proxy servers outside of PAC file!
// DO NOT enter it manually in any program! // DO NOT enter it manually in any program!
// By doing this, you harm the service!" >> "$PACFILE" // By doing this, you harm the service!" | tee -a "$PACFILE" "$PACFILE_NOSSL" >/dev/null
cp "$PACFILE" "$PACFILE_NOSSL"
echo " return \"HTTPS ${PACHTTPSHOST}; PROXY ${PACPROXYHOST}; DIRECT\";" >> "$PACFILE" echo " return \"HTTPS ${PACHTTPSHOST}; PROXY ${PACPROXYHOST}; DIRECT\";" >> "$PACFILE"
echo " return \"PROXY ${PACPROXYHOST}; DIRECT\";" >> "$PACFILE_NOSSL" echo " return \"PROXY ${PACPROXYHOST}; DIRECT\";" >> "$PACFILE_NOSSL"