Jetty 12.1 Proxy Exclusions by Host and Port
Use the Jetty 12.1 proxy excluded-address set for an exact host and optional port rather than assuming JVM nonProxyHosts controls the client.
Jetty 12.1’s HTTP client keeps destination exclusions on each proxy object. Add them before requests begin:
var proxy = new org.eclipse.jetty.client.HttpProxy(
"proxy.example", 8080);
proxy.getExcludedAddresses().add("internal.example:443");
jettyClient.getProxyConfiguration().addProxy(proxy);
jettyClient is the application’s existing org.eclipse.jetty.client.HttpClient, with its normal startup and shutdown lifecycle. For permitted public destinations, the HTTP proxy list supplies candidates for the HttpProxy host and port; keep the intended internal exclusions.
The entry matches internal.example on port 443. Without a port, a host entry matches that host on any port. Hostname matching is exact: add each intended host individually rather than supplying JVM nonProxyHosts wildcards or a pipe-separated list.
An exclusion makes this proxy object stop matching the origin. With several proxies configured, another proxy may still match; inspect the remaining candidates before calling the result a direct route.