mirror of
https://github.com/ChuckNorrison/LightningTipBot.git
synced 2026-08-20 13:28:08 +02:00
fix cfg
This commit is contained in:
parent
865592b0a6
commit
f474988606
3 changed files with 9 additions and 1 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"`
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue