Skip to content

Commit

Permalink
fix: remove duplicate reference to ProxyRotateCount in README.md
Browse files Browse the repository at this point in the history
…and add a note how to use the `RoundTripper`
  • Loading branch information
presbrey committed Aug 10, 2024
1 parent c8387ee commit bef293d
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,32 @@ The `Config` struct allows you to customize the behavior of the MultiProxy Clien
- `RetryAttempts`: Number of times to retry a failed request
- `RetryDelay`: Delay between retry attempts
- `BackoffTime`: Time to wait before retrying a failed proxy
- `ProxyRotateCount`: Number of requests after which to rotate to the next proxy
- `InsecureSkipVerify`: Whether to skip TLS certificate verification

## Using the RoundTripper

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:

```go
config := multiproxy.Config{
// ... your config here ...
}

client, err := multiproxy.NewClient(config)
if err != nil {
// handle error
}

httpClient := &http.Client{
Transport: client.RoundTripper(),
}

// Now use httpClient for your requests
resp, err := httpClient.Get("https://example.com")
```

This is particularly useful when you need to use the multi-proxy functionality with libraries or APIs that accept an `http.Client`.

## Testing

The project includes comprehensive test suites:
Expand Down

0 comments on commit bef293d

Please sign in to comment.