As substring to match in VLESS fallbacks SNI shunt

This commit is contained in:
RPRX 2021-01-15 09:43:39 +00:00 committed by GitHub
parent f13ac3cb55
commit f0efc0cfde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -226,14 +226,14 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i
} }
if len(napfb) > 1 || napfb[""] == nil { if len(napfb) > 1 || napfb[""] == nil {
if napfb[name] == nil { if name != "" && napfb[name] == nil {
generic := "*" match := ""
if index := strings.IndexByte(name, '.'); index != -1 { for n := range napfb {
generic += name[index:] if n != "" && strings.Contains(name, n) && len(n) > len(match) {
match = n
} }
if napfb[generic] != nil {
name = generic
} }
name = match
} }
} }