mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-12-24 12:10:05 +08:00
feat: allow custom ECH domain
Allowing customize the query domain for ECH, instead of leaking the ECH domain to DNS, can effectively prevent DNS leakage. This is highly necessary for most users who rely on default DNS configurations.
This commit is contained in:
parent
d8dcaa7500
commit
3dd5068675
@ -12,6 +12,7 @@ import (
|
||||
type ECHOptions struct {
|
||||
Enable bool `proxy:"enable,omitempty" obfs:"enable,omitempty"`
|
||||
Config string `proxy:"config,omitempty" obfs:"config,omitempty"`
|
||||
Domain string `proxy:"domain,omitempty" obfs:"domain,omitempty"`
|
||||
}
|
||||
|
||||
func (o ECHOptions) Parse() (*ech.Config, error) {
|
||||
@ -28,6 +29,9 @@ func (o ECHOptions) Parse() (*ech.Config, error) {
|
||||
return list, nil
|
||||
}
|
||||
} else {
|
||||
if o.Domain != "" {
|
||||
serverName = o.Domain
|
||||
}
|
||||
echConfig.GetEncryptedClientHelloConfigList = func(ctx context.Context, serverName string) ([]byte, error) {
|
||||
return resolver.ResolveECHWithResolver(ctx, serverName, resolver.ProxyServerHostResolver)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user