Add ECH TLS client

This commit is contained in:
世界
2022-09-09 18:19:50 +08:00
parent a3bb9c2877
commit 3ad4370fa5
8 changed files with 242 additions and 18 deletions

View File

@@ -21,7 +21,11 @@ func NewDialerFromOptions(router adapter.Router, dialer N.Dialer, serverAddress
}
func NewClient(router adapter.Router, serverAddress string, options option.OutboundTLSOptions) (Config, error) {
return newStdClient(serverAddress, options)
if options.ECH != nil && options.ECH.Enabled {
return newECHClient(router, serverAddress, options)
} else {
return newStdClient(serverAddress, options)
}
}
func ClientHandshake(ctx context.Context, conn net.Conn, config Config) (net.Conn, error) {