URenko / Accesser

🌏一个解决SNI RST导致维基百科、Pixiv等站点无法访问的工具 | A tool for solving SNI RST
GNU General Public License v3.0
856 stars 73 forks source link

修改PAC #60

Closed Othixx closed 4 years ago

Othixx commented 4 years ago

我先直接修改PAC,可是它似乎不起作用,原来被RST的还是RST了; 后来又改源码中的PAC,然后生成的exe还是无法使用?

Othixx commented 4 years ago

比如说我想要访问www.backchina.com,将PAC修改成了如下: var domains = { "steamcommunity.com": 1, "pixiv.net": 1, "tumblr.com": 1, "tumblr.co": 1, "google.com": 1, "instagram.com": 1, "quora.com": 1, "reddit.com": 1, "redditmedia.com": 1, "apkmirror.com": 1, "nicovideo.jp": 1, "dmc.nico": 1, "bbc.com": 1, "dropbox.com": 1, "dropboxapi.com": 1, "dropbox-dns.com": 1, "kobo.com": 1, "medium.com": 1, "pinterest.com": 1, "thetvdb.com": 1, "dw.com": 1, "imgur.com": 1, "startpage.com": 1, "uptodown.com": 1, "pornhub.com": 1, "phncdn.com": 1, "artstation.com": 1, "vimeo.com": 1, "wikipedia.org": 1, "epochtimes.com": 1, "euronews.com": 1, "reuters.com": 1, "backchina.com": 1, "google.com.hk": 1 };

var shexps = { "://steamcommunity-a.akamaihd.net/": 1, "://steamuserimages-a.akamaihd.net/": 1, "://.amazon.co.jp/": 1, "://onedrive.live.com/": 1, "://.bbc.co.uk/": 1, "://.bbci.co.uk/": 1, "://.japantimes.co.jp/": 1, "://.yahoo.co.jp/": 1, "://.cna.com.tw/*": 1 };

var proxy = "PROXY 127.0.0.1:{{port}};";

var direct = 'DIRECT;';

var hasOwnProperty = Object.hasOwnProperty;

function shExpMatchs(str, shexps) { for (shexp in shexps) { if (shExpMatch(str, shexp)) { return true; } } return false; }

function FindProxyForURL(url, host) { var suffix; var pos = host.lastIndexOf('.'); pos = host.lastIndexOf('.', pos - 1); while(1) { if (pos <= 0) { if (hasOwnProperty.call(domains, host)) { return proxy; } else if (shExpMatchs(url, shexps)) { return proxy; } else { return direct; } } suffix = host.substring(pos + 1); if (hasOwnProperty.call(domains, suffix)) { return proxy; } pos = host.lastIndexOf('.', pos - 1); } }

请问是否可行?

miaomiaosoft commented 4 years ago

可能和IE缓存有关,改完得清一下缓存

Othixx commented 4 years ago

应该不会,浏览器都删掉重装过了

URenko commented 4 years ago

@LeoXiang2003 PAC格式没问题,你看看日志里有没有收到对该网站的请求,另外这个网站的证书似乎有些问题。

SeaHOH commented 4 years ago

默认证书是自签的,backchina.com 的证书由于 GWF 干扰浏览器无法获取,可能需要抓包。