env: supports for http and socks5 proxies
This commit is contained in:
parent
386c3991cd
commit
10c113f400
10 changed files with 51 additions and 60 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"encoding/json"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
@ -45,7 +46,14 @@ func NewBotClient() BotClient {
|
|||
}
|
||||
return BotClient{
|
||||
BotClient: &gotgbot.BaseBotClient{
|
||||
Client: http.Client{},
|
||||
Client: http.Client{
|
||||
Transport: &http.Transport{
|
||||
// avoid using proxy for telegram
|
||||
Proxy: func(r *http.Request) (*url.URL, error) {
|
||||
return nil, nil
|
||||
},
|
||||
},
|
||||
},
|
||||
UseTestEnvironment: false,
|
||||
DefaultRequestOpts: &gotgbot.RequestOpts{
|
||||
Timeout: 10 * time.Minute,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue