all: support h3:// protocol prefix

This commit is contained in:
Cuong Manh Le authored and Cuong Manh Le committed 2024-09-30 18:15:01 +07:00
1 parent 082d14a9ba
commit 08fe04f1ee
3 files changed
+42 -6

No files matched your search

+5 -1
View File
@@ -1473,7 +1473,11 @@ func processNoConfigFlags(noConfigStart bool) {
endpointAndTyp := func(endpoint string) (string, string) {
typ := ctrld.ResolverTypeFromEndpoint(endpoint)
return strings.TrimPrefix(endpoint, "quic://"), typ
endpoint = strings.TrimPrefix(endpoint, "quic://")
if after, found := strings.CutPrefix(endpoint, "h3://"); found {
endpoint = "https://" + after
}
return endpoint, typ
}
pEndpoint, pType := endpointAndTyp(primaryUpstream)
upstream := map[string]*ctrld.UpstreamConfig{