Summary
In many organisations, servers don't have direct internet access — outbound connections must go through a corporate HTTP proxy. jgit-proxy currently assumes direct internet access when forwarding to upstream SCM providers. There's no way to configure an outbound proxy, making the proxy unusable in these environments.
Three outbound connection paths
Unlike a simple HTTP middleware, jgit-proxy has three distinct places that open outbound connections, each using a different library. All three need proxy support:
-
Store-and-forward upstream push — ForwardingPostReceiveHook uses JGit's Transport.open(). JGit respects Java system properties (https.proxyHost, https.proxyPort, http.nonProxyHosts) but there's no way to set these from the YAML config today.
-
Transparent proxy forwarding — GitProxyServlet (Jetty's ProxyServlet) uses Jetty's internal HttpClient. Proxy support requires calling httpClient.getProxyConfiguration().addProxy(new HttpProxy(host, port)) at servlet setup time in GitProxyServletRegistrar.registerProxyServlet().
-
Provider SCM API calls (identity resolution, etc.) — GitHubProvider, GitLabProvider, etc. use Apache HttpClient 5 via org.apache.hc.client5.http.fluent.Request. These need a RequestConfig or RoutePlanner configured with the proxy host/port.
The upstream Node.js implementation hooks proxy configuration into proxyReqOptDecorator in src/proxy/routes/index.ts (line 147, currently a no-op pass-through) — this only covers path 2. jgit-proxy needs all three covered.
Proposed configuration
New server.outboundProxy block alongside the existing timeout settings:
server:
outboundProxy:
host: proxy.corp.example.com
port: 8080
# Optional: skip proxy for these hosts (matches Java nonProxyHosts syntax)
noProxy: "localhost|*.internal.example.com"
At startup:
- Set
https.proxyHost / https.proxyPort / http.nonProxyHosts as system properties (covers JGit Transport)
- Pass proxy config into Jetty
HttpClient in registerProxyServlet() (covers transparent proxy)
- Build a shared Apache HC5
HttpClientBuilder with DefaultProxyRoutePlanner and inject it into all provider implementations (covers SCM API calls)
Documentation
The Node.js issue notes this is primarily a documentation gap for end users discovering the proxy in air-gapped environments. Alongside the config support, docs/CONFIGURATION.md should include a worked example for the corporate proxy case.
Summary
In many organisations, servers don't have direct internet access — outbound connections must go through a corporate HTTP proxy. jgit-proxy currently assumes direct internet access when forwarding to upstream SCM providers. There's no way to configure an outbound proxy, making the proxy unusable in these environments.
Three outbound connection paths
Unlike a simple HTTP middleware, jgit-proxy has three distinct places that open outbound connections, each using a different library. All three need proxy support:
Store-and-forward upstream push —
ForwardingPostReceiveHookuses JGit'sTransport.open(). JGit respects Java system properties (https.proxyHost,https.proxyPort,http.nonProxyHosts) but there's no way to set these from the YAML config today.Transparent proxy forwarding —
GitProxyServlet(Jetty'sProxyServlet) uses Jetty's internalHttpClient. Proxy support requires callinghttpClient.getProxyConfiguration().addProxy(new HttpProxy(host, port))at servlet setup time inGitProxyServletRegistrar.registerProxyServlet().Provider SCM API calls (identity resolution, etc.) —
GitHubProvider,GitLabProvider, etc. use Apache HttpClient 5 viaorg.apache.hc.client5.http.fluent.Request. These need aRequestConfigorRoutePlannerconfigured with the proxy host/port.The upstream Node.js implementation hooks proxy configuration into
proxyReqOptDecoratorinsrc/proxy/routes/index.ts(line 147, currently a no-op pass-through) — this only covers path 2. jgit-proxy needs all three covered.Proposed configuration
New
server.outboundProxyblock alongside the existing timeout settings:At startup:
https.proxyHost/https.proxyPort/http.nonProxyHostsas system properties (covers JGit Transport)HttpClientinregisterProxyServlet()(covers transparent proxy)HttpClientBuilderwithDefaultProxyRoutePlannerand inject it into all provider implementations (covers SCM API calls)Documentation
The Node.js issue notes this is primarily a documentation gap for end users discovering the proxy in air-gapped environments. Alongside the config support,
docs/CONFIGURATION.mdshould include a worked example for the corporate proxy case.