Chrome 使用 PAC 时出现 “网页可能暂时无法连接,或者它已永久性地移动到了新网址” 的解决

in #cn5 years ago (edited)

最近两天发现,Chrome(版本 72.0.3626.109)中,Proxy SwitchyOmega(2.5.20)不能使用本地PAC文件了。具体表现为选择PAC模式,打开网页时显示如图:

用谷歌搜索上述提示信息,发现了ERR_MANDATORY_PROXY_CONFIGURATION_FAILED #1474,lewixliu 在回复中写道: 

Seems it destn't work for --proxy-pac-url setting "file:///xxx" and "data:...", but works for "http://ip/xx.pac". 
So here's a workaround, which cannot update web page list automatically. 
1. export the pac script file.
2. run a web server, and put the pac file in web server.
3. disable the extension or switch to system setting.
4. run with: chrome --proxy-pac-url="http://ip/xx.pac"
I tried the workaround on one PC, it works, but didn't try more. 
@FelisCatus, If "--proxy-pac-url" not support "data:..." any more, it there other way to set proxy?

于是我把 proxy.pac 放在VPS的 /var/www/html 目录中,并在“PAC 网址”填入 http://VPS的IP\proxy.pac,再点击“立即更新情景模式 ”。这样就可以正常使用PAC模式了。

仔细观察之后,发现 Proxy SwitchyOmega 的配置页面显示:“如果您使用本地PAC文件,则该情景模式只能单独使用,无法作为自动切换的结果。这是因为浏览器不允许读取本地文件。”(SwitchyOmega 的代码中有这句话) 这正和上面 lewixliu 的说法一致。

你应该注意到了,上面点击“立即更新情景模式 ”的时候,“PAC 网址”中的PAC文件内容就被读取到了“PAC 脚本”,因此,如果没有VPS,那么不填写“PAC 网址”而直接在“PAC 脚本”填入PAC文件的内容,仍是有效的。

另外说一下,至于通过百毒搜到的以管理员权限执行 netsh winsock reset 再重启电脑的说法,纯属无稽之谈。毕竟同一台PC上其他浏览器就不存在这个问题。

特把这个过程记录下来,希望对和我遇到相同问题的人有参考价值。


Sort:  

@ericet给您叫了一份外卖!

@wilhb81 小智&小白条 迎着台风 骑着飞毯给您送来
爱心饼干

吃饱了吗?跟我猜拳吧! 石头,剪刀,布~

如果您对我的服务满意,请不要吝啬您的点赞~
@onepagex


You lose! 你输了!乖乖的给我点赞吧!


It’s a tie! 平局!再来!在猜拳界,我还没有输过!


It’s a tie! 平局!再来!在猜拳界,我还没有输过!

Congratulations @wiw! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You got more than 10 replies. Your next target is to reach 50 replies.

Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

Valentine challenge - Love is in the air!

You can upvote this notification to help all Steemit users. Learn why here!

Coin Marketplace

STEEM 0.30
TRX 0.11
JST 0.034
BTC 66408.70
ETH 3225.39
USDT 1.00
SBD 4.17