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
12
util/http.go
12
util/http.go
|
@ -5,8 +5,16 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
var httpSession = &http.Client{
|
||||
Timeout: 20 * time.Second,
|
||||
var httpSession = NewHTTPSession()
|
||||
|
||||
func NewHTTPSession() *http.Client {
|
||||
session := &http.Client{
|
||||
Timeout: 20 * time.Second,
|
||||
Transport: &http.Transport{
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
},
|
||||
}
|
||||
return session
|
||||
}
|
||||
|
||||
func GetHTTPSession() *http.Client {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue