diff --git a/config.yaml.example b/config.yaml.example index af66817..a82b3f1 100644 --- a/config.yaml.example +++ b/config.yaml.example @@ -1,4 +1,10 @@ bot: + socks_proxy: + host: 0.0.0.0:9996 + username: test + password: username + tor_proxy: + host: 0.0.0.0:9050 http_proxy: "" lnurl_public_host_name: "mylnurl.com" lnurl_server: "https://mylnurl.com" diff --git a/internal/config.go b/internal/config.go index debf517..c54b113 100644 --- a/internal/config.go +++ b/internal/config.go @@ -23,7 +23,6 @@ type SocksConfiguration struct { } type BotConfiguration struct { - HttpProxy string `yaml:"http_proxy"` SocksProxy *SocksConfiguration `yaml:"socks_proxy,omitempty"` TorProxy *SocksConfiguration `yaml:"tor_proxy,omitempty"` LNURLServer string `yaml:"lnurl_server"` diff --git a/internal/network/http.go b/internal/network/http.go index 2aa58e4..0b82555 100644 --- a/internal/network/http.go +++ b/internal/network/http.go @@ -33,6 +33,9 @@ func GetClient(clientType ClientType) (*http.Client, error) { default: return nil, fmt.Errorf("[GetClient] invalid clientType") } + if cfg == nil { + return &client, nil + } proxyURL, _ := url.Parse(cfg.Host) specialTransport := &http.Transport{} specialTransport.Proxy = http.ProxyURL(proxyURL)