config codex
sh
sudo cp /etc/mihomo/config.yaml /etc/mihomo/config.yaml.bak
sudo nano /etc/mihomo/config.yaml狗狗目前韩国比较稳定,有限使用韩国 :
sh
mixed-port: 7890
allow-lan: false
bind-address: 127.0.0.1
mode: rule
log-level: info
ipv6: false
unified-delay: true
tcp-concurrent: true
profile:
store-selected: true
proxy-providers:
subscription:
type: http
url: "在这里填写你的 Clash 订阅 URL"
path: ./proxy_providers/subscription.yaml
interval: 86400
proxy: DIRECT
health-check:
enable: true
url: https://www.gstatic.com/generate_204
interval: 300
timeout: 5000
lazy: true
proxy-groups:
- name: KOREA
type: url-test
use:
- subscription
filter: '(?i)(🇰🇷|韩国|韓國|首尔|首爾|仁川|Korea|Seoul|\bKR\b)'
url: https://www.gstatic.com/generate_204
interval: 300
tolerance: 100
timeout: 5000
empty-fallback: REJECT
- name: BACKUP
type: url-test
use:
- subscription
filter: '(?i)(🇯🇵|日本|东京|大阪|Japan|\bJP\b|🇸🇬|新加坡|狮城|Singapore|\bSG\b|🇺🇸|美国|洛杉矶|硅谷|United States|USA)'
exclude-filter: '(?i)(🇭🇰|香港|Hong Kong|\bHK\b)'
url: https://www.gstatic.com/generate_204
interval: 300
tolerance: 100
timeout: 5000
empty-fallback: REJECT
- name: PROXY
type: fallback
proxies:
- KOREA
- BACKUP
url: https://www.gstatic.com/generate_204
interval: 300
timeout: 5000
rules:
# OpenAI API、登录与 Codex
- DOMAIN-SUFFIX,openai.com,PROXY
- DOMAIN-SUFFIX,chatgpt.com,PROXY
- DOMAIN-SUFFIX,oaistatic.com,PROXY
- DOMAIN-SUFFIX,oaiusercontent.com,PROXY
# GitHub 网站、API、Git HTTPS 和下载
- DOMAIN-SUFFIX,github.com,PROXY
# GitHub Raw、Release、用户上传资源
- DOMAIN-SUFFIX,githubusercontent.com,PROXY
# GitHub 网站静态资源
- DOMAIN-SUFFIX,githubassets.com,PROXY
# GitHub Pages
- DOMAIN-SUFFIX,github.io,PROXY
# GitHub Container Registry
- DOMAIN-SUFFIX,ghcr.io,PROXY
# GitHub Copilot
- DOMAIN-SUFFIX,githubcopilot.com,PROXY
# GitHub 状态页
- DOMAIN-SUFFIX,githubstatus.com,PROXY
# 其他所有请求默认直连
- MATCH,DIRECT