Skip to content

Commit bef293d

Browse files
committed
fix: remove duplicate reference to ProxyRotateCount in README.md and add a note how to use the RoundTripper
1 parent c8387ee commit bef293d

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,32 @@ The `Config` struct allows you to customize the behavior of the MultiProxy Clien
107107
- `RetryAttempts`: Number of times to retry a failed request
108108
- `RetryDelay`: Delay between retry attempts
109109
- `BackoffTime`: Time to wait before retrying a failed proxy
110-
- `ProxyRotateCount`: Number of requests after which to rotate to the next proxy
111110
- `InsecureSkipVerify`: Whether to skip TLS certificate verification
112111

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`.
135+
113136
## Testing
114137

115138
The project includes comprehensive test suites:

0 commit comments

Comments
 (0)