env: supports for http and socks5 proxies

This commit is contained in:
stefanodvx 2025-04-14 21:50:49 +02:00
parent 386c3991cd
commit 10c113f400
10 changed files with 51 additions and 60 deletions

View file

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