all: support h3:// protocol prefix

This commit is contained in:
Cuong Manh Le
2024-09-17 16:52:50 +07:00
committed by Cuong Manh Le
parent 082d14a9ba
commit 08fe04f1ee
3 changed files with 42 additions and 6 deletions

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{