Convert Surf client to standard net/http.Client
mainYou can convert a Surf client to a standard *http.Client using the .Std() method. This allows you to use Surf's advanced features (like TLS fingerprinting, proxy config, and ordered headers) with third-party libraries that expect a standard Go client.
Preserved Features:
- JA3/TLS fingerprinting
- HTTP/2, HTTP/3 settings & fingerprinting
- Browser impersonation headers
- Ordered headers
- Cookies and sessions
- Proxy configuration
- Custom headers and User-Agent
- Timeout settings
- Redirect policies
- Request/Response middleware
Limitations:
- Retry logic
- Response body caching
- Remote address tracking
- Request timing information
// Create a Surf client with advanced features
surfClient := surf.NewClient().
Builder().
Impersonate().Chrome().
Session().
Build().
Unwrap()
// Convert to standard net/http.Client
stdClient := surfClient.Std()
// Use with any third-party library
resp, err := stdClient.Get("https://api.example.com")