Skip to content

clash如何避免代理本地host解决方案

临时解决方法

macos上启动clashx后,mac系统配置的hosts就会失效,可参考issue https://github.com/Dreamacro/clash/issues/423

更简单的解决方法

最终解决方法

缺点是,这些忽略设置会在重连网络时重置,对应的解决方法:

  1. 编辑~/.config/clash/proxyIgnoreList.plist(如果没有该文件,则新建)
xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "<http://www.apple.com/DTDs/PropertyList-1.0.dtd>">
<plist version="1.0">
<array>
	<string>192.168.0.0/16</string>
	<string>10.0.0.0/8</string>
	<string>172.16.0.0/12</string>
	<string>127.0.0.1</string>
	<string>localhost</string>
	<string>*.local</string>
	<string>*.crashlytics.com</string>
	<!-- 上面的不能删掉 -->
	<!-- https://github.com/yichengchen/clashX/discussions/964 -->
	<string>*.apple.com</string>
	...加入新的域名,如:<string>*.baidu.com</string>
</array>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "<http://www.apple.com/DTDs/PropertyList-1.0.dtd>">
<plist version="1.0">
<array>
	<string>192.168.0.0/16</string>
	<string>10.0.0.0/8</string>
	<string>172.16.0.0/12</string>
	<string>127.0.0.1</string>
	<string>localhost</string>
	<string>*.local</string>
	<string>*.crashlytics.com</string>
	<!-- 上面的不能删掉 -->
	<!-- https://github.com/yichengchen/clashX/discussions/964 -->
	<string>*.apple.com</string>
	...加入新的域名,如:<string>*.baidu.com</string>
</array>
</plist>
  1. 重启clashx