diff --git a/config/config.sh b/config/config.sh index e964003..4150c43 100755 --- a/config/config.sh +++ b/config/config.sh @@ -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" diff --git a/generate-pac.sh b/generate-pac.sh index 4654bef..e4a25a1 100755 --- a/generate-pac.sh +++ b/generate-pac.sh @@ -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"