mirror of
https://bitbucket.org/anticensority/antizapret-pac-generator-light.git
synced 2024-11-22 05:06:04 +03:00
Add Facebook and Twitter special proxy server
This commit is contained in:
parent
041774a1dc
commit
f96c42ba84
@ -4,7 +4,10 @@
|
||||
PACHTTPSHOST='proxy-ssl.antizapret.prostovpn.org:3143'
|
||||
|
||||
# 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_NOSSL="result/proxy-host-nossl.pac"
|
||||
|
@ -73,8 +73,18 @@ echo " if (domains.length < 10) return \"DIRECT\"; // list is broken
|
||||
shost = host.replace(/(.+)\.([^.]+\.[^.]+$)/, \"\$2\");
|
||||
|
||||
// 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(/(.*)\\.([^.]+\$)/);
|
||||
if (!curdomain || !curdomain[2]) {return \"DIRECT\";}
|
||||
var curhost = curdomain[1];
|
||||
@ -109,9 +119,8 @@ echo " if (domains.length < 10) return \"DIRECT\"; // list is broken
|
||||
// WARNING! WARNING! WARNING!
|
||||
// You should NOT use these proxy servers outside of PAC file!
|
||||
// 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 \"PROXY ${PACPROXYHOST}; DIRECT\";" >> "$PACFILE_NOSSL"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user