Add upstream proxy #104
Open
eraow wants to merge 7 commits into
Open
Conversation
eraow
marked this pull request as ready for review
July 13, 2026 14:24
ammario
requested changes
Jul 20, 2026
| By default httpjail contacts destination servers directly. When httpjail itself | ||
| runs in an environment that has no direct internet access — for example behind a | ||
| corporate proxy — you can route httpjail's own outbound requests through an | ||
| upstream proxy with `--upstream-proxy` (or the `HTTPJAIL_UPSTREAM_PROXY` |
Member
There was a problem hiding this comment.
Why shouldn't httpjail itself respect the standard HTTP_PROXY variables? I think it's clear on its face it wouldn't pass that down to children (as that would invalidate the whole point of the jail).
Author
There was a problem hiding this comment.
Agreed. For the first release, I’ll remove --upstream-proxy and HTTPJAIL_UPSTREAM_PROXY and use the standard HTTP_PROXY / HTTPS_PROXY environment variables for httpjail’s own egress.
Adding a dedicated CLI option and httpjail-specific env var creates an extra configuration path before we have a concrete need for it. If we later need an explicit per-invocation override, we can add it in a follow-up change.
Remove the upstream proxy CLI option and httpjail-specific environment variable, and resolve httpjail's own upstream proxy from HTTP_PROXY and HTTPS_PROXY instead. Also keep the new upstream proxy initialization logs at debug level so normal CLI output is not affected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds an
--upstream-proxyoption so httpjail can forward its own outboundrequests through an HTTP proxy. This makes httpjail usable in environments
that only allow internet access via a corporate proxy.
Motivation
I want to run httpjail behind a corporate proxy. Without this option,
httpjail connects directly to upstream hosts, which fails when direct
egress is blocked and only a proxy is permitted.
What this does
--upstream-proxy <URL>(e.g.http://proxy.example.com:8080).given proxy instead of connecting directly.
Usage
Manual verification