Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new proxy feature to the Polygon API client. Previously, the
base
parameter was used mostly for internal testing, allowing us to switch between development and production endpoints (e.g., changing the base host to point to something else). However, it was never intended to be used as a proxy, which caused confusion or limitations for users needing proxy support.To better serve your use-case, we’ve added a dedicated
proxy
parameter to theBaseClient
constructor. This new feature allows users to route API requests through a proxy server while keeping thebase
parameter focused on specifying the API endpoint.Here's what changed:
proxy
parameter to theBaseClient
constructor.proxy
is specified, the client usesurllib3.ProxyManager
to route requests through the proxy.base
parameter retains its original purpose for defining the API endpoint (e.g.,https://api.polygon.io
for production).This feature is designed for users like you who need to access the Polygon API through a proxy, whether for network security, monitoring, or organizational policies. It provides a clear and supported way to handle proxy configurations without misusing the base parameter.
Here’s how you can use the new proxy feature:
I'm checking to make sure this addition meets your needs for proxy support. By separating
base
(for endpoints) andproxy
(for routing), the client remains flexible and intuitive. Let us know if this aligns with your use-case or if there’s anything else we can adjust.