GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add HTTP proxy support via environment variables by kevinchiu · Pull Request #968 · massive-com/client-python

Conversation

@kevinchiu

@kevinchiu kevinchiu commented Nov 30, 2025

Copy link
Copy Markdown
Contributor

Automatically use urllib3.ProxyManager when HTTPS_PROXY/HTTP_PROXY environment variables are set.

Enables the client to work in proxy-required environments (corporate networks, CI/CD, sandboxed dev environments) without code changes. Follows the same convention as the requests library.

Fully backward compatible - uses PoolManager when no proxy vars are set.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kevinchiu
kevinchiu requested review from justinpolygon and penelopus as code owners November 30, 2025 05:59
@kevinchiu
Add HTTP proxy support via environment variables
3d2a238
When HTTPS_PROXY, https_proxy, HTTP_PROXY, or http_proxy environment
variables are set, use urllib3.ProxyManager instead of PoolManager.

This enables the client to work in environments that require proxy
configuration, such as corporate networks, CI/CD pipelines, and
sandboxed development environments.

The behavior is backward compatible - when no proxy environment
variables are set, PoolManager is used as before.
@kevinchiu
kevinchiu force-pushed the feature/http-proxy-support branch from cd5027c to 3d2a238 Compare August 3, 2026 21:04
@kevinchiu
kevinchiu requested review from jbonzo, kschoche, lukeoleson, mmoghaddam385 and suever as code owners August 3, 2026 21:04
@suever
suever removed the request for review from penelopus August 3, 2026 21:35
@justinpolygon justinpolygon mentioned this pull request Oct 16, 2026
[SPT-1668] Add proxy, custom CA, and connection pool options #1040
Merged
justinpolygon added a commit that referenced this pull request Oct 16, 2026
@justinpolygon @SachuJames
@Tyagiquamar @jakobovski-arb @romanzdk @kevinchiu
[SPT-1668] Add proxy, custom CA, and connection pool options
98e11ff
Combines the community PRs that change how the REST client builds its
urllib3 pool (#968, #1008, #1026, #1033, #1034).

- CA bundle: both clients verify TLS with ca_certs if given, then the
  SSL_CERT_FILE or REQUESTS_CA_BUNDLE environment variable, then
  certifi (#998).
- RESTClient(maxsize=10): connections kept per host. urllib3 defaults
  to 1, so threaded clients kept opening new TLS connections.
- RESTClient(connection_pool_kw=...): other urllib3 pool options,
  merged over the defaults (#1009).
- RESTClient(proxy=...): explicit proxy URL, with credentials from the
  URL. Proxy environment variables aren't read, so existing traffic
  doesn't change route. The WebSocket client already uses the system
  proxy via websockets.

Co-authored-by: SACHU JAMES <[email protected]>
Co-authored-by: Mohd Quamar Tyagi <[email protected]>
Co-authored-by: jakobovski-arb <[email protected]>
Co-authored-by: Roman Zydyk <[email protected]>
Co-authored-by: Kevin Chiu <[email protected]>
justinpolygon added a commit that referenced this pull request Oct 16, 2026
@justinpolygon @SachuJames
@Tyagiquamar @jakobovski-arb @romanzdk @kevinchiu
[SPT-1668] Add proxy, custom CA, and connection pool options (#1040)
670c2cc
Adds connection options to the clients, combining #968, #1008, #1026,
#1033 and #1034 (contributors are credited as co-authors).

- **Custom CA:** `ca_certs=` on `RESTClient` and `WebSocketClient`,
defaulting to `SSL_CERT_FILE` / `REQUESTS_CA_BUNDLE`, then certifi.
Closes #998.
- **Pool size:** `RESTClient(maxsize=10)`. urllib3 defaults to 1
connection per host.
- **Pool options:** `RESTClient(connection_pool_kw={...})`, merged over
the defaults. Closes #1009.
- **Proxy:** `RESTClient(proxy="http://user:pass@host:port")`. Proxy env
vars aren't read, so nobody's traffic changes route.

The README has a new **Network Configuration** section with examples for
each case (custom CA, proxy, threads, other pool options).

All new parameters are optional and added at the end of the signatures.
The one behavior change: if `SSL_CERT_FILE` or `REQUESTS_CA_BUNDLE`
points to a file, it's now used instead of certifi (as `requests` and
Python do). If it points to a file that doesn't exist, it's skipped with
a warning, so a stale value doesn't break anyone.

Verified against the live API through a local TLS-inspecting proxy
(mitmproxy with auth): REST and WebSocket connect with the proxy's CA
(argument or env var) and fail certificate verification without it;
wrong proxy credentials get 407. Under 16 threads, `maxsize=10` opened
16 TLS connections vs 57–70 with urllib3's default.

---------

Co-authored-by: SACHU JAMES <[email protected]>
Co-authored-by: Mohd Quamar Tyagi <[email protected]>
Co-authored-by: jakobovski-arb <[email protected]>
Co-authored-by: Roman Zydyk <[email protected]>
Co-authored-by: Kevin Chiu <[email protected]>
@justinpolygon

justinpolygon commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Thanks! #1040 adds proxy support (you're credited as a co-author), released in v2.9.0. For REST we made it explicit so existing setups aren't rerouted, so it's one line: RESTClient(proxy=os.environ.get("HTTPS_PROXY")). WebSocket already follows HTTPS_PROXY automatically. Closing in favor of #1040.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@justinpolygon justinpolygon closed this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@justinpolygon justinpolygon Awaiting requested review from justinpolygon justinpolygon is a code owner
@suever suever Awaiting requested review from suever suever is a code owner
@kschoche kschoche Awaiting requested review from kschoche kschoche is a code owner
@lukeoleson lukeoleson Awaiting requested review from lukeoleson lukeoleson is a code owner
@mmoghaddam385 mmoghaddam385 Awaiting requested review from mmoghaddam385 mmoghaddam385 is a code owner
@jbonzo jbonzo Awaiting requested review from jbonzo jbonzo is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@kevinchiu @justinpolygon
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.