This commit is contained in:
gohumble 2022-08-14 22:44:04 +02:00
parent 865592b0a6
commit f474988606
3 changed files with 9 additions and 1 deletions

View file

@ -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"

View file

@ -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"`

View file

@ -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)