@@ -105,6 +105,7 @@ type Config struct {
105105 DoHClientX509AuthLegacy DoHClientX509AuthConfig `toml:"tls_client_auth"`
106106 DNS64 DNS64Config `toml:"dns64"`
107107 EDNSClientSubnet []string `toml:"edns_client_subnet"`
108+ IPEncryption IPEncryptionConfig `toml:"ip_encryption"`
108109}
109110
110111func newConfig () Config {
@@ -291,6 +292,11 @@ type DNS64Config struct {
291292 Resolvers []string `toml:"resolver"`
292293}
293294
295+ type IPEncryptionConfig struct {
296+ Key string `toml:"key"`
297+ Algorithm string `toml:"algorithm"`
298+ }
299+
294300type CaptivePortalsConfig struct {
295301 MapFile string `toml:"map_file"`
296302}
@@ -443,6 +449,11 @@ func ConfigLoad(proxy *Proxy, flags *ConfigFlags) error {
443449 // Configure DNS64
444450 configureDNS64 (proxy , & config )
445451
452+ // Configure IP encryption
453+ if err := configureIPEncryption (proxy , & config ); err != nil {
454+ return err
455+ }
456+
446457 // Configure source restrictions
447458 configureSourceRestrictions (proxy , flags , & config )
448459
@@ -538,6 +549,19 @@ func configureDNS64(proxy *Proxy, config *Config) {
538549 proxy .dns64Resolvers = config .DNS64 .Resolvers
539550}
540551
552+ // configureIPEncryption - Helper function for IP encryption
553+ func configureIPEncryption (proxy * Proxy , config * Config ) error {
554+ ipCryptConfig , err := NewIPCryptConfig (
555+ config .IPEncryption .Key ,
556+ config .IPEncryption .Algorithm ,
557+ )
558+ if err != nil {
559+ return fmt .Errorf ("IP encryption configuration error: %w" , err )
560+ }
561+ proxy .ipCryptConfig = ipCryptConfig
562+ return nil
563+ }
564+
541565func (config * Config ) printRegisteredServers (proxy * Proxy , jsonOutput bool , includeRelays bool ) error {
542566 var summary []ServerSummary
543567 if includeRelays {
0 commit comments