This commit is contained in:
Achmad
2026-05-11 10:20:40 +00:00
parent 56e910b687
commit 308d66bd36
3 changed files with 5 additions and 151 deletions
+5 -2
View File
@@ -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)