You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-1Lines changed: 24 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -107,9 +107,32 @@ The `Config` struct allows you to customize the behavior of the MultiProxy Clien
107
107
-`RetryAttempts`: Number of times to retry a failed request
108
108
-`RetryDelay`: Delay between retry attempts
109
109
-`BackoffTime`: Time to wait before retrying a failed proxy
110
-
-`ProxyRotateCount`: Number of requests after which to rotate to the next proxy
111
110
-`InsecureSkipVerify`: Whether to skip TLS certificate verification
112
111
112
+
## Using the RoundTripper
113
+
114
+
The MultiProxy Client provides a `RoundTripper()` method that returns an `http.RoundTripper`. This allows you to use the multi-proxy functionality with any `http.Client`. Here's an example:
115
+
116
+
```go
117
+
config:= multiproxy.Config{
118
+
// ... your config here ...
119
+
}
120
+
121
+
client, err:= multiproxy.NewClient(config)
122
+
if err != nil {
123
+
// handle error
124
+
}
125
+
126
+
httpClient:= &http.Client{
127
+
Transport: client.RoundTripper(),
128
+
}
129
+
130
+
// Now use httpClient for your requests
131
+
resp, err:= httpClient.Get("https://example.com")
132
+
```
133
+
134
+
This is particularly useful when you need to use the multi-proxy functionality with libraries or APIs that accept an `http.Client`.
0 commit comments