Fix proxy-provider bypass: use ?provider=1 param instead of custom header

Custom header X-Proxy-Provider is not sent by ClashMi and other clients
that don't support header: in proxy-providers. URL query param works in
all clients universally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ivan Razin
2026-06-24 20:07:33 +03:00
co-authored by Claude Sonnet 4.6
parent b846756a6d
commit 482749c966
2 changed files with 4 additions and 7 deletions
+1 -4
View File
@@ -53,12 +53,9 @@ dns:
proxy-providers:
sub:
type: http
url: https://${DOMAIN}/${SUB_PATH}/${SUB_ID}
url: https://${DOMAIN}/${SUB_PATH}/${SUB_ID}?provider=1
path: ./proxy_providers/base64.yml
interval: 3600
header:
X-Proxy-Provider:
- "true"
health-check:
enable: true
url: https://www.gstatic.com/generate_204
+3 -3
View File
@@ -417,9 +417,9 @@ map \$http_user_agent \$is_clash_ua {
~*(clash|clashx|clashn|mihomo|stash|surfboard) 1;
default 0;
}
# Serve clash.yaml only when: Clash UA AND no X-Proxy-Provider header
# (proxy-provider refresh requests carry X-Proxy-Provider: true and must get the real sub)
map "\$is_clash_ua:\$http_x_proxy_provider" \$serve_clash_yaml {
# Serve clash.yaml only when: Clash UA AND no ?provider=1 query param
# (proxy-provider refresh requests add ?provider=1 and must get the real sub)
map "\$is_clash_ua:\$arg_provider" \$serve_clash_yaml {
"1:" 1;
default 0;
}