feat(ednsdiag): support custom DoH endpoint via --url
Allow overriding the provider preset with an explicit HTTPS DoH URL, including validation that custom endpoints apply only to DoH queries.
This commit is contained in:
@@ -129,6 +129,8 @@ func parseQueryArgs(args []string) (edns.QueryOptions, time.Duration, error) {
|
||||
options.Protocol = strings.ToLower(value)
|
||||
case "provider":
|
||||
options.Provider = strings.ToLower(value)
|
||||
case "url":
|
||||
options.EndpointURL = value
|
||||
case "method":
|
||||
options.Method = strings.ToLower(value)
|
||||
case "timeout":
|
||||
@@ -178,5 +180,5 @@ func writeUsage(writer io.Writer) {
|
||||
}
|
||||
|
||||
func writeQueryUsage(writer io.Writer) {
|
||||
fmt.Fprintln(writer, "usage: ednsdiag query <domain> [type] [--protocol doh|dot] [--provider cloudflare|google|quad9|adguard] [--method post|get] [--timeout 5s]")
|
||||
fmt.Fprintln(writer, "usage: ednsdiag query <domain> [type] [--protocol doh|dot] [--provider cloudflare|google|quad9|adguard] [--url https://host/dns-query] [--method post|get] [--timeout 5s]")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user