mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-03-31 17:10:29 +02:00
- Create httputil_utls.go with uTLS/Cloudflare bypass for Android (build tag: !ios) - Create httputil_ios.go with fallback implementation for iOS (build tag: ios) - Remove uTLS-dependent code from httputil.go (shared code) - Fixes iOS build failure due to undefined DNS resolver symbols (_res_9_*)
28 lines
782 B
Go
28 lines
782 B
Go
//go:build ios
|
|
|
|
package gobackend
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
// iOS version: uTLS is not supported on iOS due to cgo DNS resolver issues
|
|
// Fall back to standard HTTP client
|
|
|
|
// GetCloudflareBypassClient returns the standard HTTP client on iOS
|
|
// uTLS is not available on iOS due to cgo DNS resolver compatibility issues
|
|
func GetCloudflareBypassClient() *http.Client {
|
|
return sharedClient
|
|
}
|
|
|
|
// DoRequestWithCloudflareBypass on iOS just uses the standard client
|
|
// uTLS Chrome fingerprint bypass is not available on iOS
|
|
func DoRequestWithCloudflareBypass(req *http.Request) (*http.Response, error) {
|
|
req.Header.Set("User-Agent", getRandomUserAgent())
|
|
resp, err := sharedClient.Do(req)
|
|
if err != nil {
|
|
CheckAndLogISPBlocking(err, req.URL.String(), "HTTP")
|
|
}
|
|
return resp, err
|
|
}
|