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:
co-authored by
Claude Sonnet 4.6
parent
b846756a6d
commit
482749c966
@@ -53,12 +53,9 @@ dns:
|
|||||||
proxy-providers:
|
proxy-providers:
|
||||||
sub:
|
sub:
|
||||||
type: http
|
type: http
|
||||||
url: https://${DOMAIN}/${SUB_PATH}/${SUB_ID}
|
url: https://${DOMAIN}/${SUB_PATH}/${SUB_ID}?provider=1
|
||||||
path: ./proxy_providers/base64.yml
|
path: ./proxy_providers/base64.yml
|
||||||
interval: 3600
|
interval: 3600
|
||||||
header:
|
|
||||||
X-Proxy-Provider:
|
|
||||||
- "true"
|
|
||||||
health-check:
|
health-check:
|
||||||
enable: true
|
enable: true
|
||||||
url: https://www.gstatic.com/generate_204
|
url: https://www.gstatic.com/generate_204
|
||||||
|
|||||||
+3
-3
@@ -417,9 +417,9 @@ map \$http_user_agent \$is_clash_ua {
|
|||||||
~*(clash|clashx|clashn|mihomo|stash|surfboard) 1;
|
~*(clash|clashx|clashn|mihomo|stash|surfboard) 1;
|
||||||
default 0;
|
default 0;
|
||||||
}
|
}
|
||||||
# Serve clash.yaml only when: Clash UA AND no X-Proxy-Provider header
|
# Serve clash.yaml only when: Clash UA AND no ?provider=1 query param
|
||||||
# (proxy-provider refresh requests carry X-Proxy-Provider: true and must get the real sub)
|
# (proxy-provider refresh requests add ?provider=1 and must get the real sub)
|
||||||
map "\$is_clash_ua:\$http_x_proxy_provider" \$serve_clash_yaml {
|
map "\$is_clash_ua:\$arg_provider" \$serve_clash_yaml {
|
||||||
"1:" 1;
|
"1:" 1;
|
||||||
default 0;
|
default 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user