-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0197b4b
commit 0a9b454
Showing
5 changed files
with
231 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: JavaScript | ||
--- | ||
|
||
使用 `JavaScript` 对配置进行修改 | ||
|
||
程序的入口为 `main` 函数,接受一个 `config` 参数 (名称不限制),并返回修改后的该参数 | ||
|
||
下方演示为在 `rules` 开头插入一条规则 | ||
|
||
```js | ||
function main(config) { | ||
config.rules.unshift("DOMAIN,google.com,DIRECT"); | ||
return config; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,193 @@ | ||
--- | ||
title: YAML | ||
--- | ||
|
||
import { Tabs, TabItem } from '@astrojs/starlight/components'; | ||
|
||
使用 `深度合并` 对原配置进行覆写,优先级低于应用常用配置覆写 | ||
|
||
如果目标是是简单值或者数组,将直接覆盖 | ||
|
||
如果遇到嵌套的对象,函数会进一步递归合并这些嵌套的对象 | ||
|
||
如果是[rules](https://wiki.metacubex.one/config/rules/)/[proxies](https://wiki.metacubex.one/config/proxies/),则在数组开头进行填充 | ||
|
||
|
||
<Tabs> | ||
<TabItem label="覆写前内容"> | ||
|
||
```yaml | ||
mixed-port: 7890 | ||
|
||
dns: | ||
enable: true | ||
ipv6: true | ||
enhanced-mode: fake-ip | ||
fake-ip-range: 28.0.0.1/8 | ||
nameserver: [https://dns.alidns.com/dns-query] | ||
|
||
proxies: | ||
- name: ss | ||
type: ss | ||
server: 127.0.0.1 | ||
port: 443 | ||
password: mihomo | ||
cipher: none | ||
|
||
proxy-groups: | ||
- name: "国内" | ||
type: select | ||
proxies: | ||
- DIRECT | ||
|
||
rules: | ||
- GEOIP,CN,DIRECT | ||
- MATCH,home | ||
``` | ||
</TabItem> | ||
<TabItem label="要覆写的内容"> | ||
```yaml | ||
mixed-port: 7895 | ||
external-ui: ui | ||
|
||
|
||
sniffer: | ||
enable: true | ||
override-destination: false | ||
sniff: | ||
HTTP: | ||
ports: [80, 8080-8880] | ||
override-destination: true | ||
TLS: | ||
ports: [443, 8443] | ||
QUIC: | ||
ports: [443, 8443] | ||
|
||
tun: | ||
enable: true | ||
stack: mixed | ||
auto-route: true | ||
auto-detect-interface: true | ||
strict-route: false | ||
dns-hijack: | ||
- any:53 | ||
|
||
dns: | ||
enable: true | ||
listen: :1053 | ||
ipv6: true | ||
enhanced-mode: fake-ip | ||
fake-ip-filter: | ||
- "*" | ||
- "+.lan" | ||
- "+.local" | ||
- live-push.bilivideo.com | ||
default-nameserver: | ||
- https://223.5.5.5/dns-query | ||
nameserver: | ||
- https://dns.alidns.com/dns-query | ||
- https://doh.pub/dns-query | ||
|
||
proxies: | ||
- name: 直连 | ||
type: direct | ||
|
||
rule-providers: | ||
cn_domain: | ||
type: http | ||
interval: 86400 | ||
behavior: domain | ||
format: mrs | ||
url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/cn.mrs" | ||
|
||
rules: | ||
- RULE-SER,cn_domain,CN | ||
|
||
proxy-groups: | ||
- name: CN | ||
type: select | ||
proxies: | ||
- DIRECT | ||
|
||
``` | ||
|
||
</TabItem> | ||
<TabItem label="输出内容"> | ||
|
||
```yaml | ||
mixed-port: 7895 | ||
external-ui: ui | ||
|
||
sniffer: | ||
enable: true | ||
override-destination: false | ||
sniff: | ||
HTTP: | ||
ports: [80, 8080-8880] | ||
override-destination: true | ||
TLS: | ||
ports: [443, 8443] | ||
QUIC: | ||
ports: [443, 8443] | ||
|
||
tun: | ||
enable: true | ||
stack: mixed | ||
auto-route: true | ||
auto-detect-interface: true | ||
strict-route: false | ||
dns-hijack: | ||
- any:53 | ||
|
||
|
||
dns: | ||
enable: true | ||
listen: :1053 | ||
ipv6: true | ||
enhanced-mode: fake-ip | ||
fake-ip-range: 28.0.0.1/8 | ||
fake-ip-filter: | ||
- "*" | ||
- "+.lan" | ||
- "+.local" | ||
- live-push.bilivideo.com | ||
default-nameserver: | ||
- https://223.5.5.5/dns-query | ||
nameserver: | ||
- https://dns.alidns.com/dns-query | ||
- https://doh.pub/dns-query | ||
|
||
proxies: | ||
- name: 直连 | ||
type: direct | ||
- name: ss | ||
type: ss | ||
server: 127.0.0.1 | ||
port: 443 | ||
password: mihomo | ||
cipher: none | ||
|
||
proxy-groups: | ||
- name: CN | ||
type: select | ||
proxies: | ||
- DIRECT | ||
|
||
rules: | ||
- RULE-SET,cn_domain,CN | ||
- GEOIP,CN,DIRECT | ||
- MATCH,home | ||
|
||
rule-providers: | ||
cn_domain: | ||
type: http | ||
interval: 86400 | ||
behavior: domain | ||
format: mrs | ||
url: https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/cn.mrs | ||
``` | ||
</TabItem> | ||
</Tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters