update
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"net/http/cookiejar"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -37,7 +38,8 @@ func SetVerboseLog(enabled bool) {
|
||||
}
|
||||
|
||||
func ProxyEnabled() bool {
|
||||
if globalProxy {
|
||||
envProxy := os.Getenv("FLARESOLVERR_PROXY") == "1"
|
||||
if globalProxy || envProxy {
|
||||
return true
|
||||
}
|
||||
if config.IsFlareSolverrProxyEnabled() {
|
||||
@@ -90,6 +92,7 @@ func WithVerboseLog(enabled bool) Option {
|
||||
|
||||
func NewClient(opts ...Option) *Client {
|
||||
jar, _ := cookiejar.New(nil)
|
||||
vLog := os.Getenv("VERBOSE_LOG") == "1"
|
||||
c := &Client{
|
||||
http: &http.Client{Timeout: 30 * time.Second, Jar: jar},
|
||||
fsClient: globalFSClient,
|
||||
@@ -97,7 +100,7 @@ func NewClient(opts ...Option) *Client {
|
||||
rateLimit: 1,
|
||||
burst: 1,
|
||||
limiters: map[string]*rate.Limiter{},
|
||||
verboseLog: verboseLog,
|
||||
verboseLog: verboseLog || vLog,
|
||||
}
|
||||
for _, o := range opts {
|
||||
o(c)
|
||||
|
||||
Reference in New Issue
Block a user