Chrome 主机规则谷歌浏览器,添加配置

tnkciper  于 2023-03-21  发布在  Go
关注(0)|答案(5)|浏览(258)

我不明白,我试图转发每一个http请求到一个特定的域,除了几个网站。
它工作正常,但有一个例外:

"/path/to/chrome.exe" --host-rules="MAP * www.domain.de, 
EXCLUDE *.youtube.*"

但我没有得到它的工作与多个域,例如:

"/path/to/chrome.exe" --host-rules="MAP * www.domain.de, 
EXCLUDE *.youtube.*" *.last.fm"

"/path/to/chrome.exe" --host-rules="MAP * www.domain.de, 
EXCLUDE *.youtube.*", *.last.fm"

格式错误在哪里?:-/
正如描述(http://peter.sh/experiments/chromium-command-line-switches/#host-rules)所说:

Comma-separated list of rules that control how hostnames are mapped. 
For example: "MAP * 127.0.0.1" --> Forces all hostnames to be mapped to 127.0.0.1 
"MAP *.google.com proxy" --> Forces all google.com subdomains to be resolved to "proxy". 
"MAP test.com [::1]:77 --> Forces "test.com" to resolve to IPv6 loopback. 
Will also force the port of the resulting socket address to be 77. "MAP * baz, EXCLUDE www.google.com" 
--> Remaps everything to "baz", except for "www.google.com". 
These mappings apply to the endpoint host in a net::URLRequest 
(the TCP connect and host resolver in a direct connection, and the CONNECT in an http proxy connection, 
and the endpoint host in a SOCKS proxy connection).
46qrfjad

46qrfjad1#

我好像在回答一个老问题,但无论如何...
您发布了:

"/path/to/chrome.exe" --host-rules="MAP * www.domain.de, EXCLUDE *.youtube.*", *.last.fm"

我认为你的例子中的引用是混乱的。它应该是:

"/path/to/chrome.exe" --host-rules="MAP * www.domain.de, EXCLUDE *.youtube.*, *.last.fm"
b4wnujal

b4wnujal2#

除了修复引用拼写错误外,您还应该在每个排除域之前写入EXCLUDE

"/path/to/chrome.exe" --host-rules="MAP * www.domain.de, EXCLUDE *.youtube.*, EXCLUDE *.last.fm"
dwbf0jvd

dwbf0jvd3#

Windows中,您必须这样编写:

"/path/to/chrome.exe" --host-rules="MAP * www.domain.de, EXCLUDE *.youtube.*","MAP * www.domain.de, EXCLUDE *.last.fm"

注意MAP规则之间没有逗号!

u4dcyp6a

u4dcyp6a4#

(On窗口)
在我的例子中,我只有"MAP *.co.za 172.11.12.13",启动chrome时它忽略了Map。当我添加Exclude google.co.za的一部分时,它工作了:
总结:
不起作用:

"/path/to/chrome.exe" --host-rules="MAP *.co.za 172.11.12.13"

有效:

"/path/to/chrome.exe" --host-rules="MAP *.co.za 172.11.12.13, Exclude google.co.za"
v9tzhpje

v9tzhpje5#

语法如下所示:
“C:\程序文件\Google\Chrome\应用程序\Chrome. exe”--主机解析器规则=“Map主机110.10.10.10,Map主机2 10.10.10.10,Map主机3 10.10.10.10”
另外请注意,我使用--host-resolver-rules而不是--host-rules,因为--host-rules会给我带来证书方面的问题

相关问题