Skip to content

Instantly share code, notes, and snippets.

@yuzhi535
Created August 21, 2022 11:06
Show Gist options
  • Save yuzhi535/e8bfe80b8f819550c77de25c027769ae to your computer and use it in GitHub Desktop.
Save yuzhi535/e8bfe80b8f819550c77de25c027769ae to your computer and use it in GitHub Desktop.
my clash configuration
port: 30144
socks-port: 30145
allow-lan: true
mode: Rule
log-level: info
external-controller: :9090
# DNS server settings
# This section is optional. When not present, the DNS server will be disabled.
dns:
enable: false
listen: 0.0.0.0:53
# ipv6: false # when the false, response to AAAA questions will be empty
# These nameservers are used to resolve the DNS nameserver hostnames below.
# Specify IP addresses only
default-nameserver:
- 114.114.114.114
- 8.8.8.8
enhanced-mode: fake-ip # or redir-host (not recommended)
fake-ip-range: 198.18.0.1/16 # Fake IP addresses pool CIDR
# use-hosts: true # lookup hosts and return IP record
# Hostnames in this list will not be resolved with fake IPs
# i.e. questions to these domain names will always be answered with their
# real IP addresses
# fake-ip-filter:
# - '*.lan'
# - localhost.ptlogin2.qq.com
# Supports UDP, TCP, DoT, DoH. You can specify the port to connect to.
# All DNS questions are sent directly to the nameserver, without proxies
# involved. Clash answers the DNS question with the first result gathered.
nameserver:
- 114.114.114.114 # default value
- 8.8.8.8 # default value
- tls://dns.rubyfish.cn:853 # DNS over TLS
- https://1.1.1.1/dns-query # DNS over HTTPS
- dhcp://en0 # dns from dhcp
# - '8.8.8.8#en0'
# When `fallback` is present, the DNS server will send concurrent requests
# to the servers in this section along with servers in `nameservers`.
# The answers from fallback servers are used when the GEOIP country
# is not `CN`.
# fallback:
# - tcp://1.1.1.1
# - 'tcp://1.1.1.1#en0'
# If IP addresses resolved with servers in `nameservers` are in the specified
# subnets below, they are considered invalid and results from `fallback`
# servers are used instead.
#
# IP address resolved with servers in `nameserver` is used when
# `fallback-filter.geoip` is true and when GEOIP of the IP address is `CN`.
#
# If `fallback-filter.geoip` is false, results from `nameserver` nameservers
# are always used if not match `fallback-filter.ipcidr`.
#
# This is a countermeasure against DNS pollution attacks.
fallback-filter:
geoip: true
geoip-code: CN
ipcidr:
- 240.0.0.0/4
domain:
- '+.google.com'
- '+.facebook.com'
- '+.youtube.com'
# Lookup domains via specific nameservers
nameserver-policy:
'www.baidu.com': '114.114.114.114'
'+.internal.crop.com': '10.0.0.1'
proxies:
- name: t1
server: xxx
port: xxx
type: trojan
password: xxx
skip-cert-verify: true
udp: true
- name: t2
server: xxx
port: xxx
type: trojan
password: xxx
skip-cert-verify: true
udp: true
- name: t3
server: xxx
port: xxx
type: trojan
password: xxx
skip-cert-verify: true
udp: true
proxy-groups:
- name: ๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
type: select
proxies:
- โ™ป๏ธ ่‡ชๅŠจ้€‰ๆ‹ฉ
- ๐ŸŽฏ ๅ…จ็ƒ็›ด่ฟž
- t1
- t2
- t3
- name: โ™ป๏ธ ่‡ชๅŠจ้€‰ๆ‹ฉ
type: url-test
url: http://www.gstatic.com/generate_204
interval: 300
proxies:
- bestUS
- bestHK
- t3
- name: ่ดŸ่ฝฝๅ‡่กก
type: load-balance
proxies:
- t1
- t2
- t3
url: http://www.gstatic.com/generate_204
interval: 300
- name: ๐ŸŽฅ NETFLIX
type: select
proxies:
- ๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
- โ™ป๏ธ ่‡ชๅŠจ้€‰ๆ‹ฉ
- ๐ŸŽฏ ๅ…จ็ƒ็›ด่ฟž
- t1
- t2
- t3
- name: โ›”๏ธ ๅนฟๅ‘Šๆ‹ฆๆˆช
type: select
proxies:
- ๐Ÿ›‘ ๅ…จ็ƒๆ‹ฆๆˆช
- ๐ŸŽฏ ๅ…จ็ƒ็›ด่ฟž
- ๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
- name: ๐Ÿšซ ่ฟ่ฅๅŠซๆŒ
type: select
proxies:
- ๐Ÿ›‘ ๅ…จ็ƒๆ‹ฆๆˆช
- ๐ŸŽฏ ๅ…จ็ƒ็›ด่ฟž
- ๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
- name: ๐ŸŒ ๅ›ฝๅค–ๅช’ไฝ“
type: select
proxies:
- ๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
- โ™ป๏ธ ่‡ชๅŠจ้€‰ๆ‹ฉ
- ๐ŸŽฏ ๅ…จ็ƒ็›ด่ฟž
- t1
- t2
- t3
- name: ๐ŸŒ ๅ›ฝๅ†…ๅช’ไฝ“
type: select
proxies:
- ๐ŸŽฏ ๅ…จ็ƒ็›ด่ฟž
- ๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
- name: โ“‚๏ธ ๅพฎ่ฝฏๆœๅŠก
type: select
proxies:
- ๐ŸŽฏ ๅ…จ็ƒ็›ด่ฟž
- ๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
- t1
- t2
- t3
- name: ๐Ÿ“ฒ ็”ตๆŠฅไฟกๆฏ
type: select
proxies:
- ๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
- ๐ŸŽฏ ๅ…จ็ƒ็›ด่ฟž
- t1
- t2
- t3
- name: ๐ŸŽ ่‹นๆžœๆœๅŠก
type: select
proxies:
- ๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
- ๐ŸŽฏ ๅ…จ็ƒ็›ด่ฟž
- โ™ป๏ธ ่‡ชๅŠจ้€‰ๆ‹ฉ
- t1
- t2
- t3
- name: ๐ŸŽฏ ๅ…จ็ƒ็›ด่ฟž
type: select
proxies:
- DIRECT
- name: ๐Ÿ›‘ ๅ…จ็ƒๆ‹ฆๆˆช
type: select
proxies:
- REJECT
- DIRECT
- name: ๐ŸŸ ๆผ็ฝ‘ไน‹้ฑผ
type: select
proxies:
- ๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
- ๐ŸŽฏ ๅ…จ็ƒ็›ด่ฟž
- โ™ป๏ธ ่‡ชๅŠจ้€‰ๆ‹ฉ
- t1
- t2
- t3
rule-providers:
reject:
type: http
behavior: domain
url: "https://raw.fastgit.org/Loyalsoldier/clash-rules/release/reject.txt"
path: ./ruleset/reject.yaml
interval: 86400
icloud:
type: http
behavior: domain
url: "https://raw.fastgit.org/Loyalsoldier/clash-rules/release/icloud.txt"
path: ./ruleset/icloud.yaml
interval: 86400
apple:
type: http
behavior: domain
url: "https://raw.fastgit.org/Loyalsoldier/clash-rules/release/apple.txt"
path: ./ruleset/apple.yaml
interval: 86400
google:
type: http
behavior: domain
url: "https://raw.fastgit.org/Loyalsoldier/clash-rules/release/google.txt"
path: ./ruleset/google.yaml
interval: 86400
proxy:
type: http
behavior: domain
url: "https://raw.fastgit.org/Loyalsoldier/clash-rules/release/proxy.txt"
path: ./ruleset/proxy.yaml
interval: 86400
direct:
type: http
behavior: domain
url: "https://raw.fastgit.org/Loyalsoldier/clash-rules/release/direct.txt"
path: ./ruleset/direct.yaml
interval: 86400
private:
type: http
behavior: domain
url: "https://raw.fastgit.org/Loyalsoldier/clash-rules/release/private.txt"
path: ./ruleset/private.yaml
interval: 86400
gfw:
type: http
behavior: domain
url: "https://raw.fastgit.org/Loyalsoldier/clash-rules/release/gfw.txt"
path: ./ruleset/gfw.yaml
interval: 86400
greatfire:
type: http
behavior: domain
url: "https://raw.fastgit.org/Loyalsoldier/clash-rules/release/greatfire.txt"
path: ./ruleset/greatfire.yaml
interval: 86400
tld-not-cn:
type: http
behavior: domain
url: "https://raw.fastgit.org/Loyalsoldier/clash-rules/release/tld-not-cn.txt"
path: ./ruleset/tld-not-cn.yaml
interval: 86400
telegramcidr:
type: http
behavior: ipcidr
url: "https://raw.fastgit.org/Loyalsoldier/clash-rules/release/telegramcidr.txt"
path: ./ruleset/telegramcidr.yaml
interval: 86400
cncidr:
type: http
behavior: ipcidr
url: "https://raw.fastgit.org/Loyalsoldier/clash-rules/release/cncidr.txt"
path: ./ruleset/cncidr.yaml
interval: 86400
lancidr:
type: http
behavior: ipcidr
url: "https://raw.fastgit.org/Loyalsoldier/clash-rules/release/lancidr.txt"
path: ./ruleset/lancidr.yaml
interval: 86400
applications:
type: http
behavior: classical
url: "https://raw.fastgit.org/Loyalsoldier/clash-rules/release/applications.txt"
path: ./ruleset/applications.yaml
interval: 86400
proxy-applications:
type: http
behavior: classical
url: "https://raw.fastgit.org/yuzhi535/clash-rules/release/proxy-applications.txt"
path: ./ruleset/applications.yaml
interval: 86400
rules:
- RULE-SET,applications,DIRECT
- RULE-SET,proxy-applications,๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
- DOMAIN,clash.razord.top,DIRECT
- DOMAIN,yacd.haishan.me,DIRECT
- RULE-SET,private,DIRECT
- RULE-SET,reject,โ›”๏ธ ๅนฟๅ‘Šๆ‹ฆๆˆช
- RULE-SET,icloud,๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
- RULE-SET,apple,๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
- RULE-SET,google,๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
- RULE-SET,proxy,๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
- RULE-SET,direct,๐ŸŽฏ ๅ…จ็ƒ็›ด่ฟž
- RULE-SET,lancidr,DIRECT
- RULE-SET,cncidr,๐ŸŽฏ ๅ…จ็ƒ็›ด่ฟž
- RULE-SET,telegramcidr,๐Ÿ“ฒ ็”ตๆŠฅไฟกๆฏ
- GEOIP,LAN,DIRECT
- GEOIP,CN,DIRECT
- MATCH,๐Ÿ”ฐ ่Š‚็‚น้€‰ๆ‹ฉ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment