Add PublicAddressBind config and update TCP listener usage

This commit is contained in:
dd dd 2024-08-02 01:17:12 +02:00
parent 16277358fe
commit 782e27d545
2 changed files with 4 additions and 3 deletions

View File

@ -12,6 +12,7 @@ import (
type EntryConfig struct { type EntryConfig struct {
NostrRelays []string `env:"NOSTR_RELAYS" envSeparator:";"` NostrRelays []string `env:"NOSTR_RELAYS" envSeparator:";"`
PublicAddress string `env:"PUBLIC_ADDRESS"` PublicAddress string `env:"PUBLIC_ADDRESS"`
PublicAddressBind string `env:"PUBLIC_ADDRESS_BIND"`
} }
type ExitConfig struct { type ExitConfig struct {

View File

@ -99,7 +99,7 @@ func New(conf *Config, pool *nostr.SimplePool, config *config.EntryConfig) (*Ser
pool: pool, pool: pool,
} }
if conf.entryConfig.PublicAddress != "" { if conf.entryConfig.PublicAddress != "" {
listener, err := NewTCPListener(conf.entryConfig.PublicAddress) listener, err := NewTCPListener(conf.entryConfig.PublicAddressBind)
if err != nil { if err != nil {
return nil, err return nil, err
} }