Host-rules google chrome, adding configuration

匿名 (未验证) 提交于 2019-12-03 08:48:34

问题:

i dont get it, i try to forward every http request to a specific domain except a couple of websites.

It is working with one exception:

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

But i dont get it work with multiple domains eg.:

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

or

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

Where is my formatting error? :-/

As the description (http://peter.sh/experiments/chromium-command-line-switches/#host-rules) says:

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).  

回答1:

I appear to be answering an old question, but anyway...

You posted:

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

I think the quoting is messed up in your example. It should be:

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


回答2:

In Windows you have to write it this way:

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

Pay attention that there is no comma between the MAP rules!



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!