From 3dd506867542f12e0fbcfbdf50c592acec951ef6 Mon Sep 17 00:00:00 2001 From: Bblythe <167680887+ibblythe@users.noreply.github.com> Date: Wed, 3 Dec 2025 12:17:22 +0800 Subject: [PATCH] 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. --- adapter/outbound/ech.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adapter/outbound/ech.go b/adapter/outbound/ech.go index 47d9df4d..70314411 100644 --- a/adapter/outbound/ech.go +++ b/adapter/outbound/ech.go @@ -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) }