Verify steps
Description
Issue Description
The parse_singbox_dns() function in scripts/starts/singbox_modify.sh doesn't properly handle DoH (DNS-over-HTTPS) server URLs because it strips the URL path component, which is required by some DoH servers.
Current Behavior
When parsing DoH URLs like:
https://dns.google/dns-query
https://dns.controld.com/unique_identifier_path
The function only extracts the protocol and server, discarding the path:
{"type": "https", "server": "dns.google"}
{"type": "https", "server": "dns.controld.com"}
Expected Behavior
For some DoH servers, the full URL path should be preserved. Sing-box allows the server path to be included in the DNS module. The output should be something like:
{"type": "https", "server": "dns.controld.com", "path": "/unique_identifier_path"}
Impact
Some DoH providers require specific URL paths:
- ControlD:
https://dns.controld.com/unique_identifier_path (custom paths per user)
Without the path field, these DoH servers won't work correctly.
Affected Code
File: scripts/starts/singbox_modify.sh
Lines 27-30 - This is where the path gets stripped:
*)
server="${tmp%%[:/]*}" # ⚠️ This line strips everything after the first : or /
port="${tmp#*:}"
[ "$port" = "$tmp" ] && port=""
;;
For a URL like https://dns.controld.com/unique_path:
tmp = dns.controld.com/unique_path
server="${tmp%%[:/]*}" extracts only dns.controld.com and discards /unique_path
Verify steps
Description
Issue Description
The
parse_singbox_dns()function inscripts/starts/singbox_modify.shdoesn't properly handle DoH (DNS-over-HTTPS) server URLs because it strips the URL path component, which is required by some DoH servers.Current Behavior
When parsing DoH URLs like:
https://dns.google/dns-queryhttps://dns.controld.com/unique_identifier_pathThe function only extracts the protocol and server, discarding the path:
{"type": "https", "server": "dns.google"}{"type": "https", "server": "dns.controld.com"}Expected Behavior
For some DoH servers, the full URL path should be preserved. Sing-box allows the server path to be included in the DNS module. The output should be something like:
{"type": "https", "server": "dns.controld.com", "path": "/unique_identifier_path"}Impact
Some DoH providers require specific URL paths:
https://dns.controld.com/unique_identifier_path(custom paths per user)Without the path field, these DoH servers won't work correctly.
Affected Code
File:
scripts/starts/singbox_modify.shLines 27-30 - This is where the path gets stripped:
For a URL like
https://dns.controld.com/unique_path:tmp=dns.controld.com/unique_pathserver="${tmp%%[:/]*}"extracts onlydns.controld.comand discards/unique_path