mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-07-29 15:28:48 +02:00
- Resolve over DNS-over-HTTPS (1.1.1.1/8.8.8.8, cached, SSRF-filtered) when the OS resolver fails, on all transports and the uTLS dial path, so DNS-level ISP blocking no longer kills the connection outright - Flush the pooled uTLS h2 conns from CloseIdleConnections so a network switch no longer leaves the first bypass request hanging on a dead conn - Abort retry backoff sleeps on context cancellation - Cap honored Retry-After at 2 minutes - Restore the response body consumed by the 403/451 marker scan
23 lines
434 B
Go
23 lines
434 B
Go
//go:build ios
|
|
|
|
package gobackend
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
func GetCloudflareBypassClient() *http.Client {
|
|
return sharedClient
|
|
}
|
|
|
|
func closeUTLSIdleConnections() {}
|
|
|
|
func DoRequestWithCloudflareBypass(req *http.Request) (*http.Response, error) {
|
|
req.Header.Set("User-Agent", userAgentForURL(req.URL))
|
|
resp, err := sharedClient.Do(req)
|
|
if err != nil {
|
|
CheckAndLogISPBlocking(err, req.URL.String(), "HTTP")
|
|
}
|
|
return resp, err
|
|
}
|