refactor: use per-source HTTP client instead of global proxy
- Remove global ProxyEnabled() logic from httpclient - Each source now explicitly chooses client at import time: - flare client: for JS-rendering/cloudflare sources - normal httpclient: for REST API sources - Updated 29 base sources based on Kotlin reference (network.cloudflareClient)
This commit is contained in:
@@ -6,11 +6,9 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"goyomi/internal/config"
|
||||
"goyomi/internal/db"
|
||||
"goyomi/internal/httpclient"
|
||||
_ "goyomi/internal/registry"
|
||||
_ "goyomi/sources/all/hentaihand"
|
||||
_ "goyomi/sources/all/kemono"
|
||||
@@ -46,16 +44,6 @@ func main() {
|
||||
// Initialize config manager
|
||||
config.InitConfigManager(database.Queries)
|
||||
|
||||
if os.Getenv("FLARESOLVERR_URL") != "" {
|
||||
fsClient, err := httpclient.NewFlareSolverrClient()
|
||||
if err != nil {
|
||||
log.Printf("flaresolverr: client creation failed: %v", err)
|
||||
} else {
|
||||
httpclient.SetGlobalFlareSolverr(fsClient)
|
||||
log.Printf("flaresolverr: client initialized")
|
||||
}
|
||||
}
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintln(w, "ok")
|
||||
|
||||
Reference in New Issue
Block a user