id: 81e5348806704b18a7c99753fe60d071
parent_id: 
item_type: 1
item_id: a4fe32966a5c48858ff4bcf53b646255
item_updated_time: 1764345601281
title_diff: "[{\"diffs\":[[1,\"Clash使用Parser添加自定义规则并防止更新覆盖 - 知乎\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":32}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>Clash使用Parser添加自定义规则并防止更新覆盖 - 知乎</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"25275\\\"></a>\\\r\\\n<h1>Clash使用Parser添加自定义规则并防止更新覆盖 - 知乎</h1>\\\r\\\n\\\r\\\n<div><span>\\\n  <div style=\\\"--en-clipped-content:simplified; --en-clipped-source-url:https://zhuanlan.zhihu.com/p/336003879; --en-clipped-source-title:Clash使用Parser添加自定义规则并防止更新覆盖 - 知乎;\\\">\\\n<div><br/></div><div style=\\\"min-height: 9461px; font-size: 16px; display:block; min-width: 100%;\\\"> <div style=\\\"background-color:transparent;font:inherit;vertical-align:baseline;\\\"><div style=\\\"background-color:transparent;font:inherit;vertical-align:baseline;font-family:&quot;PT Serif&quot;;font-size:16px;line-height:1.5em;color:rgb(31, 9, 9);text-align:left;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;width:36em;z-index:200;padding-left:2em;padding-right:2em;margin-left:auto;margin-right:auto;position:relative;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;position:relative;margin-left:-25px;margin-right:25px;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;padding-top:0px;padding-bottom:9em;position:relative;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;position:relative;margin-bottom:0px;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:0px;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:0px;\\\"><h1 style=\\\"font-family:&quot;PT Serif&quot;;text-align:left;border:0px;font:inherit;vertical-align:baseline;font-size:35px;font-weight:normal;line-height:35px;margin-bottom:20px;padding:0px;margin:0px;\\\">Clash使用Parser添加自定义规则并防止更新覆盖</h1><div style=\\\"padding:0px;border:0px;font:inherit;vertical-align:baseline;position:relative;height:1em;line-height:1;text-align:center;margin:0px;padding-top:1.5em;padding-bottom:1.5em;margin-bottom:0px;\\\"><div style=\\\"padding:0px;border:0px;font:inherit;vertical-align:baseline;background:-webkit-linear-gradient(0deg, rgb(243, 242, 238) 1%, rgb(31, 9, 9) 50%, rgb(243, 242, 238) 99%);position:absolute;left:-4em;top:50%;z-index:10;width:100%;padding-left:4em;padding-right:4em;height:0.1em;opacity:0.5;margin:0px;margin-bottom:0px;\\\"><span style=\\\"font:inherit;position:absolute;left:-4em;top:50%;z-index:10;width:100%;padding-left:4em;padding-right:4em;height:0.1em;margin:0px;opacity:0.5;background:-webkit-linear-gradient(0deg, rgb(243, 242, 238) 1%, rgb(31, 9, 9) 50%, rgb(243, 242, 238) 99%);\\\"></span></div></div></div><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:0px;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:0px;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\"><span style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:0px;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:0px;\\\"><a href=\\\"https://www.zhihu.com/people/xi-huang-5\\\" style=\\\"color:rgb(6, 85, 136);margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;text-decoration:none;\\\">Lokfar</a></div></div></span></div><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:0px;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:0px;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:0px;\\\">Nothing to show.</div></div></div></div></div></div><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">Clash可以说是当下最好用的代理软件了，功能丰富，界面清爽，简单易用。但同样的Clash也面临着订阅规则不完善的情况，比如本人经常使用的Notion笔记软件（notion.so)，就没有加入本人订阅节点的规则中，以至于每次只能开启全局模式才能打开，其中的不便之处不言而喻。熟悉Clash的同学应该知道Clash提供了自定义新规则的功能界面，对于小白来说十分友好，但是这种方式有一个致命的缺陷，就是每一次更新订阅节点，自定义规则就会被覆盖，造成规则丢失。本文将介绍一种使用Clash的Parser功能，通过书写javascript代码，对订阅规则进行预处理的方式添加自定义规则，这种方式能够避免订阅更新造成的规则丢失。</p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">值得注意的是，<b style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;\\\">本方法非常简单</b>，<b style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;\\\">没有编程基础也可以轻松使用</b>。</p><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;margin-bottom:1em;margin-top:1em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;text-align:center;margin-top:1em;margin-bottom:0px;\\\"><img src=\\\":/8f263728c6564bbe8fbd9c3d8180e1a7\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-e3e49dc4b00c0ceef4addf2b51eecdeb_1440w.jpg\\\" height=\\\"409\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;max-width:100%;\\\" width=\\\"576\\\"/></div></div><h2 style=\\\"font-family:&quot;PT Serif&quot;;text-align:left;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;font-size:30px;line-height:35px;margin-top:35px;margin-bottom:15px;\\\">方法详细介绍</h2><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\"><b style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;\\\">Note:</b> 使用该方法需要Clash版本高于0.11.10，如果低于该版本，请先上github下载安装包进行更新。</p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\"><b style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;\\\">传送门：</b> <a href=\\\"https://link.zhihu.com/?target=https%3A//github.com/Dreamacro/clash/releases/tag/v1.3.0\\\" style=\\\"color:rgb(6, 85, 136);margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;text-decoration:none;\\\">Clash下载地址</a></p><ol style=\\\"padding:0px;border:0px;font:inherit;vertical-align:baseline;margin:0px 0px 1.5em 1.5em;list-style:decimal;margin-top:-1em;list-style-type:decimal;\\\"><li style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;list-style-type:inherit;list-style-position:outside;\\\">打开<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">Setting</code>（设置），找到<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">Profiles</code>（配置文件下）的<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">Parsers</code>。</li></ol><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;margin-bottom:1em;margin-top:1em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;text-align:center;margin-top:1em;margin-bottom:0px;\\\"><img src=\\\":/4b1c164b29e1455f908ff96fc2ec7077\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-a07788cf72a439356dc5f0a20daea381_1440w.jpg\\\" height=\\\"409\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;max-width:100%;\\\" width=\\\"576\\\"/></div></div><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">2. 点击右侧的<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">Edit</code>，打开编辑界面。</p><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;margin-bottom:1em;margin-top:1em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;text-align:center;margin-top:1em;margin-bottom:0px;\\\"><img src=\\\":/b3d0790133b749c7a34af7d506583e67\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-8261e449a3912896b1a15396dd19faca_1440w.jpg\\\" height=\\\"409\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;max-width:100%;\\\" width=\\\"576\\\"/></div></div><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">3. 输入以下代码（以下为示例代码，需要根据自身情况进行改动）：</p><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\"><pre style=\\\"background-color:rgb(243, 242, 238);font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;width:auto;font-size:0.875em;line-height:1.71429em;\\\"><code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;line-height:1.71429em;font-size:1.15em;\\\">parsers: # array\\\n  - url: https://sub.paasi.com/subscribe/5**490/J*****oGHBE\\\n    yaml:\\\n      prepend-rules:\\\n        - DOMAIN-SUFFIX,notion.so,GLOBAL\\\n    - DOMAIN-SUFFIX,medium.com,GLOBAL\\\n</code></pre></div><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">其中需要改动的有 <b style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;\\\">url</b> 和 <b style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;\\\">prepend-rules</b>。</p><ul style=\\\"padding:0px;border:0px;font:inherit;vertical-align:baseline;margin:0px 0px 1.5em 1.5em;list-style:none;margin-top:-1em;list-style-type:disc;\\\"><li style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;list-style-type:inherit;list-style-position:outside;\\\">url：改成本人的订阅地址，如果不知道，可以直接在<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">Profiles</code>下点击当前订阅的<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">Change imformation</code>，复制其中的URL即可。</li><li style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;list-style-type:inherit;list-style-position:outside;\\\"> prepen-rules 此处添加你的自定义规则，每一条占一行，按照<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">规则类型</code>，<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">值</code>，<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">代理策略</code>排列，使用逗号分隔。注意的是，每一行都需要以一个短横线 <code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">-</code> 加一个空格  开头，同时注意对齐。具体的自定义规则如何书写在本文的后半部分有说明。</li></ul><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">4. 点击右下角保存，在<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">Profiles</code>里更新订阅，这样就可以将新的规则添加上了。可以点击<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">Edit rules</code>查看规则进行验证。之后打开相应网页看是否生效。</p><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;margin-bottom:1em;margin-top:1em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;text-align:center;margin-top:1em;margin-bottom:0px;\\\"><img src=\\\":/df69390458ca4f429da82d371196bb37\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-80b0fdb03155aeeaa37b8a3588403113_1440w.jpg\\\" height=\\\"409\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;max-width:100%;\\\" width=\\\"576\\\"/></div></div><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;margin-bottom:1em;margin-top:1em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;text-align:center;margin-top:1em;margin-bottom:0px;\\\"><img src=\\\":/3098041b690b45419323881d7a4cb78b\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-657e545fa23e4e6767db65d3af484c65_1440w.jpg\\\" height=\\\"409\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;max-width:100%;\\\" width=\\\"576\\\"/></div></div><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;margin-bottom:1em;margin-top:1em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;text-align:center;margin-top:1em;margin-bottom:0px;\\\"><img src=\\\":/1e790f6d00a04fbc9c0d75a9373dfe26\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-7251ddd6b7cd11fbd88bde3e39cb6165_1440w.jpg\\\" height=\\\"409\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;max-width:100%;\\\" width=\\\"576\\\"/></div></div><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;margin-bottom:1em;margin-top:1em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;text-align:center;margin-top:1em;margin-bottom:0px;\\\"><img src=\\\":/df94e56a54dd47188cf016e1ea183e01\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-fd0d0288d330cde9cdb095a34e506516_1440w.jpg\\\" height=\\\"354\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;max-width:100%;\\\" width=\\\"576\\\"/></div></div><h2 style=\\\"font-family:&quot;PT Serif&quot;;text-align:left;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;font-size:30px;line-height:35px;margin-top:35px;margin-bottom:15px;\\\">自定义规则的书写方式</h2><h2 style=\\\"font-family:&quot;PT Serif&quot;;text-align:left;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;font-size:30px;line-height:35px;margin-top:35px;margin-bottom:15px;\\\">规则类型的选择</h2><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">目前Clash支持的规则类型如下:</p><ul style=\\\"padding:0px;border:0px;font:inherit;vertical-align:baseline;margin:0px 0px 1.5em 1.5em;list-style:none;margin-top:-1em;list-style-type:disc;\\\"><li style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;list-style-type:inherit;list-style-position:outside;\\\">DOMAIN-SUFFIX：域名后缀匹配</li><li style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;list-style-type:inherit;list-style-position:outside;\\\">DOMAIN：域名匹配</li><li style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;list-style-type:inherit;list-style-position:outside;\\\">DOMAIN-KEYWORD：域名关键字匹配</li><li style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;list-style-type:inherit;list-style-position:outside;\\\">IP-CIDR：IP段匹配</li><li style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;list-style-type:inherit;list-style-position:outside;\\\">SRC-IP-CIDR：源IP段匹配</li><li style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;list-style-type:inherit;list-style-position:outside;\\\">GEOIP：GEOIP数据库（国家代码）匹配</li><li style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;list-style-type:inherit;list-style-position:outside;\\\">DST-PORT：目标端口匹配</li><li style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;list-style-type:inherit;list-style-position:outside;\\\">SRC-PORT：源端口匹配</li><li style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;list-style-type:inherit;list-style-position:outside;\\\">PROCESS-NAME：源进程名匹配</li><li style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;list-style-type:inherit;list-style-position:outside;\\\">RULE-SET：Rule Provider规则匹配</li><li style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;list-style-type:inherit;list-style-position:outside;\\\">MATCH：全匹配</li></ul><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">其中我们使用最多的就是<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">DOMAIN-SUFFIX</code>域名后缀了。以 <a href=\\\"https://link.zhihu.com/?target=https%3A//docs.cfw.lbyczf.com/contents/mixin.html\\\" style=\\\"color:rgb(6, 85, 136);margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;text-decoration:none;\\\">https://docs.cfw.lbyczf.com/contents/mixin.html</a> 为例，该网址的域名就是<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">docs.cfw.lbyczf.com</code>。后缀就是域名从后往前数形成的部分。有些公司会在基础域名上加上前缀，将其解析到一个独立的IP地址。比如<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">world.taobao.com</code>，是在<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">taobao.com</code>前加上了域名前缀<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">world</code>。还有一个常见的前缀是<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">www</code>。如果我需要将<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">world.taobao.com</code>和<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">taobao.com</code>都添加到自定义规则中。我们就可以使用域名后缀<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">DOMAIN-SUFFIX</code>这一类型，同时将值填写为<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">taobao.com</code>就可以了。一般情况下都建议使用<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">DOMAIN-SUFFIX</code>，而不是<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">DOMAIN</code>，因为很多时候你不知道你的使用的服务的域名结构，很多时候会跳转到一个带前缀的子域名上，这个时候突然发现打不开了就很尴尬。</p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">其余规则类型根据说明大家也可以基本猜到其用法，读者可以自行探索。</p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\"><b style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;\\\">Note:</b> </p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">使用<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">PROCESS-NAME</code>需要 Clash for Windows v0.11.5 及以上版本；规则需要匹配完整的进程名（包括可执行文件后缀）方可生效；该规则不适用于TAP流量。</p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">用户界面暂不支持添加<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">RULE-SET</code>规则，请手动编辑配置文件。</p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\"><code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">MATCH</code>需要位于规则列表末尾。</p><h2 style=\\\"font-family:&quot;PT Serif&quot;;text-align:left;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;font-size:30px;line-height:35px;margin-top:35px;margin-bottom:15px;\\\">代理策略的选择</h2><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">自定义规则的第二部分<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">值</code>根据规则类型和需求进行填写，自定义规则的第三部分就是<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">代理策略</code>，在这里可以填写代理节点或者策略，有哪一些代理和策略可供选择可以通过Clash进行查看，点击Profiles，选择你的订阅，点击Edit rules进入规则编辑界面，点击Add, 下拉即可看到所有的可选节点或策略。</p><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;margin-bottom:1em;margin-top:1em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;text-align:center;margin-top:1em;margin-bottom:0px;\\\"><img src=\\\":/6a996dc3b01a4e8395e4ca4a6c841c43\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-27d1414888379205001537059f404ce5_1440w.jpg\\\" height=\\\"409\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;max-width:100%;\\\" width=\\\"576\\\"/></div></div><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;margin-bottom:1em;margin-top:1em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;text-align:center;margin-top:1em;margin-bottom:0px;\\\"><img height=\\\"409\\\" src=\\\"data:image/svg+xml;utf8,&lt;svg xmlns='http://www.w3.org/2000/svg' width='850' height='603'&gt;&lt;/svg&gt;\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;max-width:100%;\\\" width=\\\"576\\\"></img></div></div><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">一般情况我们使用<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">DIRECT</code>，<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">GLOBAL</code>，<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">REJECT</code>。<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">DIRECT</code>表示不走代理，即不通过代理节点直接连接。<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">GLOBAL</code>则是走全局代理节点。<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">REJECT</code>则表示禁止连接，使用<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">REJECT</code>后，将会屏蔽对应网站。</p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">有一些订阅还提供了很多自制的策略，读者可以自行尝试。使用时直接输入名字即可，中文也是支持的哦。有人可能会问，<b style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;\\\">前面有奇奇怪怪的符号怎么办？</b></p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">点击<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">General</code>，点击<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">Home Directory</code>下的<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">Open Folder</code>，打开配置文件夹，点击<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">Profiles</code>,找到对应的<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">yml</code>文件，用<code style=\\\"font-family:Inconsolata;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-size:0.875em;line-height:1.71429em;\\\">Notepad++</code>等软件打开，直接复制粘贴就可以啦。</p><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;margin-bottom:1em;margin-top:1em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;text-align:center;margin-top:1em;margin-bottom:0px;\\\"><img height=\\\"409\\\" src=\\\"data:image/svg+xml;utf8,&lt;svg xmlns='http://www.w3.org/2000/svg' width='850' height='603'&gt;&lt;/svg&gt;\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;max-width:100%;\\\" width=\\\"576\\\"></img></div></div><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;margin-bottom:1em;margin-top:1em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;text-align:center;margin-top:1em;margin-bottom:0px;\\\"><img height=\\\"325\\\" src=\\\"data:image/svg+xml;utf8,&lt;svg xmlns='http://www.w3.org/2000/svg' width='963' height='543'&gt;&lt;/svg&gt;\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;max-width:100%;\\\" width=\\\"576\\\"></img></div></div><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;margin-bottom:1em;margin-top:1em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;text-align:center;margin-top:1em;margin-bottom:0px;\\\"><img height=\\\"292\\\" src=\\\"data:image/svg+xml;utf8,&lt;svg xmlns='http://www.w3.org/2000/svg' width='1059' height='536'&gt;&lt;/svg&gt;\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;max-width:100%;\\\" width=\\\"576\\\"></img></div></div><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">至此，规则的书写就介绍完毕啦，下面是几个正确的示例：</p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">IP-CIDR,123.253.240.0/22,DIRECT</p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">DOMAIN-SUFFIX,netflixdnstest0.com,代理</p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">DOMAIN-SUFFIX,flash.cn,REJECT</p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">DOMAIN-SUFFIX,notion.so,GLOBAL</p><h2 style=\\\"font-family:&quot;PT Serif&quot;;text-align:left;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;font-size:30px;line-height:35px;margin-top:35px;margin-bottom:15px;\\\">原理介绍</h2><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">为什么这种方法能够防止覆盖呢？原因是Parser功能是配置文件进行预处理，因此，每一次更新都会执行一次Parser，因此自定义规则会永远存在，只要你不删除Parser。</p><h2 style=\\\"font-family:&quot;PT Serif&quot;;text-align:left;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;font-size:30px;line-height:35px;margin-top:35px;margin-bottom:15px;\\\">拓展</h2><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">Parser是一个非常强大的功能，可以通过这个功能对订阅文件进行许多预处理，达到许多非常丰富的效果。但是这个功能对于小白来说并不太友好，有兴趣的读者可以查看Clash的文档进行学习。祝大家都能愉快的工作和学习~</p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\"><b style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;\\\">传送门：</b><a href=\\\"https://link.zhihu.com/?target=https%3A//docs.cfw.lbyczf.com/contents/parser.html\\\" style=\\\"color:rgb(6, 85, 136);margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;text-decoration:none;\\\">Clash文档</a></p><hr style=\\\"border-color:rgb(31, 9, 9);border-top:none;border-right:none;border-bottom:1px solid;border-left:none;\\\"/><h2 style=\\\"font-family:&quot;PT Serif&quot;;text-align:left;margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;font-weight:bold;font-size:30px;line-height:35px;margin-top:35px;margin-bottom:15px;\\\">问题回复</h2><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">有多个机场怎么办？</p><p style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;margin-bottom:1.5em;\\\">需要在parser下每个机场都写一遍配置，简单来说，copy一下，然后修改url就好了，如下图所示</p><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;margin-bottom:1em;margin-top:1em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;text-align:center;margin-top:1em;margin-bottom:0px;\\\"><img height=\\\"429\\\" src=\\\"data:image/svg+xml;utf8,&lt;svg xmlns='http://www.w3.org/2000/svg' width='1409' height='1050'&gt;&lt;/svg&gt;\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;max-width:100%;\\\" width=\\\"576\\\"></img></div></div><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;margin-bottom:1em;margin-top:1em;\\\"><div style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;text-align:center;margin-top:1em;margin-bottom:0px;\\\"><img height=\\\"367\\\" src=\\\"data:image/svg+xml;utf8,&lt;svg xmlns='http://www.w3.org/2000/svg' width='597' height='380'&gt;&lt;/svg&gt;\\\" style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;display:block;max-width:100%;\\\" width=\\\"576\\\"></img></div></div><blockquote style=\\\"margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline;quotes:none;font-style:italic;border-left:5px solid;margin-left:2em;padding-left:1em;margin-bottom:0px;\\\"><span style=\\\"font:inherit;quotes:none;font-style:italic;\\\"></span> 封面图源网络，侵删。<br/> 文章转载请注明出处和作者，欢迎转载。<span style=\\\"font:inherit;quotes:none;font-style:italic;\\\"></span></blockquote></div></div></div></div></div></div></div></div></div></div>\\\n</div>\\\n</span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":31087}]"
metadata_diff: {"new":{"id":"a4fe32966a5c48858ff4bcf53b646255","parent_id":"f67288c3a0be4374b5d532b5dcc3aabc","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764348817281,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T21:03:20.557Z
created_time: 2025-11-28T21:03:20.557Z
type_: 13