ClashX 与机场订阅的最佳实践:完整配置指南 2025

Article 18 cover image

什么是机场订阅

机场订阅(Airport Subscription)是一种方便用户获取和更新代理节点的方式。通过一个订阅链接,ClashX 可以自动获取服务商提供的所有节点信息,并支持定期更新,无需手动添加节点。

订阅服务通常由代理服务商(俗称"机场")提供,用户购买服务后会获得一个订阅链接。这个链接包含了所有可用节点的配置信息,包括服务器地址、端口、加密方式等。

💡
为什么叫"机场"?

"机场"这个名称来源于早期 Shadowsocks 项目的图标是一个纸飞机,而提供 Shadowsocks 服务的地方被戏称为"飞机场",后来简化为"机场"。虽然现在支持的协议远不止 Shadowsocks,但这个名称已经成为代理服务商的通用称呼。

订阅的优势

  • 自动更新:服务商更新节点后,用户只需点击更新即可获取最新配置
  • 批量管理:一次性导入所有节点,无需逐个添加
  • 配置同步:一个订阅链接可在多个设备使用
  • 规则集成:订阅通常包含分流规则,开箱即用
  • 节点优选:支持自动测速和负载均衡

订阅链接的类型

目前主流的订阅链接格式有以下几种,了解它们的区别有助于正确使用:

1. Clash 订阅(推荐)

专为 Clash 系列客户端设计的订阅格式,包含完整的配置信息。

特点:

  • YAML 格式配置文件
  • 包含代理组(Proxy Group)配置
  • 内置分流规则(Rule)
  • 支持策略组和自动选择
  • ClashX 原生支持,无需转换

链接示例:

https://example.com/clash/subscribe?token=abc123

2. 通用订阅(需转换)

兼容多种客户端的订阅格式,通常为 SS/SSR/V2Ray 节点列表。

特点:

  • 通常以 sublink 标识
  • 仅包含节点信息,不含规则
  • 需要通过订阅转换器转换为 Clash 格式
  • 兼容性好,支持多种客户端

链接示例:

https://example.com/sub?token=abc123

3. Base64 订阅

节点信息经过 Base64 编码的订阅链接。

特点:

  • 内容经过 Base64 编码
  • 主要用于 Shadowsocks/ShadowsocksR
  • 需要转换为 Clash 格式使用
  • 安全性相对较低(编码非加密)
⚠️
重要提示

ClashX 原生支持 Clash 格式订阅。如果你的机场提供的是通用订阅或 Base64 订阅,需要先通过订阅转换工具转换为 Clash 格式才能在 ClashX 中使用。

article18.section3.title

article18.section3.p1

article18.section3.method1Title

article18.section3.stepsLabel

  1. article18.section3.method1.step1
  2. article18.section3.method1.step2
  3. article18.section3.method1.step3
  4. article18.section3.method1.step4
  5. article18.section3.method1.step5
  6. article18.section3.method1.step6
  7. article18.section3.method1.step7

article18.section3.method2Title

article18.section3.stepsLabel

  1. article18.section3.method2.step1
  2. article18.section3.method2.step2
  3. article18.section3.method2.step3
  4. article18.section3.method2.step4
  5. article18.section3.method2.step5

article18.section3.verifyTitle

article18.section3.checklistTitle

  • article18.section3.verify1
  • article18.section3.verify2
  • article18.section3.verify3
  • article18.section3.verify4
🎯
article18.section3.tipTitle

article18.section3.tipDesc

article18.section4.title

article18.section4.p1

article18.section4.item1Title

article18.section4.item1.reasonTitle

  • article18.section4.item1.reason1
  • article18.section4.item1.reason2
  • article18.section4.item1.reason3
  • article18.section4.item1.reason4

article18.section4.item1.freqTitle

  • article18.section4.item1.freq1
  • article18.section4.item1.freq2
  • article18.section4.item1.freq3

article18.section4.item2Title

  1. article18.section4.item2.step1
  2. article18.section4.item2.step2
  3. article18.section4.item2.step3
  4. article18.section4.item2.step4
  5. article18.section4.item2.step5
  6. article18.section4.item2.step6

article18.section4.item3Title

article18.section4.item3.p1

article18.section4.item3.methodTitle

  1. article18.section4.item3.step1
  2. article18.section4.item3.step2
  3. article18.section4.item3.step3
# 订阅自动更新间隔(小时)
update-interval: 24

# 启动时自动更新
update-on-start: true

article18.section4.item3.noteTitle

  • article18.section4.item3.note1
  • article18.section4.item3.note2

article18.section4.item4Title

article18.section4.item4.p1

article18.section4.item4.namingTitle

  • article18.section4.item4.naming1
  • article18.section4.item4.naming2
  • article18.section4.item4.naming3

article18.section4.item4.strategyTitle

  • article18.section4.item4.strategy1
  • article18.section4.item4.strategy2
  • article18.section4.item4.strategy3

article18.section4.item5Title

💾
article18.section4.item5.subtitle

article18.section4.item5.p1

article18.section5.title

article18.section5.p1

article18.section5.subconverterTitle

article18.section5.subconverterDesc

article18.section5.onlineTitle

article18.section5.onlinePlatformsTitle

  • article18.section5.onlinePlatform1
  • article18.section5.onlinePlatform2
  • article18.section5.onlinePlatform3

article18.section5.onlineStepsTitle

  1. article18.section5.onlineStep1
  2. article18.section5.onlineStep2
  3. article18.section5.onlineStep3
  4. article18.section5.onlineStep4
  5. article18.section5.onlineStep5
  6. article18.section5.onlineStep6
  7. article18.section5.onlineStep7

article18.section5.localTitle

article18.section5.localDesc

article18.section5.dockerTitle

# 拉取镜像
docker pull tindy2013/subconverter

# 运行容器
docker run -d --name subconverter \\
  -p 25500:25500 \\
  tindy2013/subconverter

# 访问本地转换服务
# http://localhost:25500

article18.section5.localAccessTitle

http://localhost:25500/sub?target=clash&url=你的订阅链接

article18.section5.advancedTitle

article18.section5.advancedParamsTitle

  • article18.section5.paramTarget
  • article18.section5.paramUrl
  • article18.section5.paramConfig
  • article18.section5.paramInclude
  • article18.section5.paramExclude
  • article18.section5.paramEmoji
  • article18.section5.paramUdp

article18.section5.sampleTitle

http://localhost:25500/sub?target=clash&url=订阅链接&include=(香港|台湾|HK|TW)&emoji=true
🔒
article18.section5.privacyTitle

article18.section5.privacyDesc

  • article18.section5.privacyTip1
  • article18.section5.privacyTip2
  • article18.section5.privacyTip3
  • article18.section5.privacyTip4

article18.section6.title

article18.section6.p1

article18.section6.item1Title

article18.section6.item1.principleTitle

  • article18.section6.item1.point1
  • article18.section6.item1.point2
  • article18.section6.item1.point3
  • article18.section6.item1.point4

article18.section6.item2Title

article18.section6.item2.checkTitle

  1. article18.section6.item2.step1
  2. article18.section6.item2.step2
  3. article18.section6.item2.step3
  4. article18.section6.item2.step4

article18.section6.item3Title

⚠️
article18.section6.item3.warningTitle
  • article18.section6.item3.point1
  • article18.section6.item3.point2
  • article18.section6.item3.point3
  • article18.section6.item3.point4
  • article18.section6.item3.point5

article18.section6.item3.tip

article18.section6.item4Title

article18.section6.item4.monitorTitle

  • article18.section6.item4.point1
  • article18.section6.item4.point2
  • article18.section6.item4.point3
  • article18.section6.item4.point4

article18.section6.item5Title

article18.section6.item5.strategyTitle

  • article18.section6.item5.point1
  • article18.section6.item5.point2
  • article18.section6.item5.point3
  • article18.section6.item5.point4
  • article18.section6.item5.point5

article18.section7.title

article18.section7.p1

article18.section7.problem1Title

article18.section7.problem1.causesTitle

  • article18.section7.problem1.cause1
  • article18.section7.problem1.cause2
  • article18.section7.problem1.cause3
  • article18.section7.problem1.cause4

article18.section7.problem1.solutionTitle

  1. article18.section7.problem1.solution1
  2. article18.section7.problem1.solution2
  3. article18.section7.problem1.solution3
  4. article18.section7.problem1.solution4
  5. article18.section7.problem1.solution5

article18.section7.problem2Title

article18.section7.problem2.stepsTitle

  1. article18.section7.problem2.step1
  2. article18.section7.problem2.step2
  3. article18.section7.problem2.step3
  4. article18.section7.problem2.step4
  5. article18.section7.problem2.step5
  6. article18.section7.problem2.step6

article18.section7.problem3Title

article18.section7.problem3.analysisTitle

  • article18.section7.problem3.case1
  • article18.section7.problem3.case2
  • article18.section7.problem3.case3

article18.section7.problem3.solutionTitle

  • article18.section7.problem3.solution1
  • article18.section7.problem3.solution2
  • article18.section7.problem3.solution3

article18.section7.problem4Title

article18.section7.problem4.causesTitle

  • article18.section7.problem4.cause1
  • article18.section7.problem4.cause2
  • article18.section7.problem4.cause3

article18.section7.problem4.solutionTitle

  1. article18.section7.problem4.solution1
  2. article18.section7.problem4.solution2
  3. article18.section7.problem4.solution3
  4. article18.section7.problem4.solution4

article18.section7.problem5Title

article18.section7.problem5.symptomTitle

  • article18.section7.problem5.symptom1
  • article18.section7.problem5.symptom2
  • article18.section7.problem5.symptom3

article18.section7.problem5.solutionTitle

  1. article18.section7.problem5.solution1
  2. article18.section7.problem5.solution2
  3. article18.section7.problem5.solution3
  4. article18.section7.problem5.solution4
🛠️
article18.section7.generalTipTitle

article18.section7.generalTipDesc

  1. article18.section7.generalStep1
  2. article18.section7.generalStep2
  3. article18.section7.generalStep3
  4. article18.section7.generalStep4
  5. article18.section7.generalStep5
  6. article18.section7.generalStep6
  7. article18.section7.generalStep7

article18.section8.title

article18.section8.p1

article18.section8.item1Title

article18.section8.item1.desc

  1. article18.section8.item1.step1
  2. article18.section8.item1.step2
  3. article18.section8.item1.step3
  4. article18.section8.item1.step4

article18.section8.item2Title

article18.section8.item2.p1

article18.section8.item2.stepsTitle

  1. article18.section8.item2.step1
  2. article18.section8.item2.step2
  3. article18.section8.item2.step3
  4. article18.section8.item2.step4
  5. article18.section8.item2.step5

article18.section8.item2.exampleTitle

rules:
  # 自定义规则 - 优先级最高
  - DOMAIN-SUFFIX,openai.com,Proxy
  - DOMAIN-SUFFIX,chatgpt.com,Proxy
  - DOMAIN-KEYWORD,google,Proxy

  # 以下是订阅原有规则
  - DOMAIN-SUFFIX,google.com,Proxy
  # ...

article18.section8.item3Title

article18.section8.item3.directTitle

# 国内网站直连
- DOMAIN-SUFFIX,taobao.com,DIRECT
- DOMAIN-SUFFIX,jd.com,DIRECT

# IP 段直连
- IP-CIDR,192.168.0.0/16,DIRECT
- IP-CIDR,10.0.0.0/8,DIRECT

article18.section8.item3.assignTitle

# Netflix 使用美国节点
- DOMAIN-SUFFIX,netflix.com,US-Node

# 游戏使用香港节点
- DOMAIN-SUFFIX,steam.com,HK-Node

article18.section8.item3.blockTitle

# 屏蔽常见广告域名
- DOMAIN-SUFFIX,googleads.com,REJECT
- DOMAIN-SUFFIX,doubleclick.net,REJECT
- DOMAIN-KEYWORD,analytics,REJECT

article18.section8.item4Title

article18.section8.item4.p1

rule-providers:
  reject:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt"
    path: ./ruleset/reject.yaml
    interval: 86400

rules:
  - RULE-SET,reject,REJECT
  # 其他规则...

article18.section8.item4.noteTitle

  • article18.section8.item4.note1
  • article18.section8.item4.note2
  • article18.section8.item4.note3
  • article18.section8.item4.note4

article18.section8.item5Title

⚠️
article18.section8.item5.tipTitle

article18.section8.item5.p1

  • article18.section8.item5.solution1
  • article18.section8.item5.solution2
  • article18.section8.item5.solution3

article18.section8.item5.p2

config=https://你的自定义规则配置地址

article18.section9.title

article18.section9.p1

article18.section9.keyPointsTitle

  • article18.section9.keyPoint1
  • article18.section9.keyPoint2
  • article18.section9.keyPoint3
  • article18.section9.keyPoint4
  • article18.section9.keyPoint5

article18.section9.bestPracticeTitle

article18.section9.checklistTitle
  • article18.section9.checklist1
  • article18.section9.checklist2
  • article18.section9.checklist3
  • article18.section9.checklist4
  • article18.section9.checklist5
  • article18.section9.checklist6

article18.section9.learnMoreTitle

article18.section9.learnMoreDesc

  • article18.section9.learnMore1
  • article18.section9.learnMore2
  • article18.section9.learnMore3
  • article18.section9.learnMore4
  • article18.section9.learnMore5
💡
article18.section9.noticeTitle

article18.section9.noticeDesc