By default, many popular constructs in Java applications (such as Spring's RestTemplate) do not honor the HTTP_PROXY/HTTPS_PROXY environment variables. It is possible to use implementation specific proxy-aware constructs to pass traffic to the Failure Flags proxy- however, the JVM has builtin proxy mechanism that simplify leveraging Failure Flags and have the additional benefit of being framework/implementation agnostic.
The following JVM runtime options can be set to pass traffic in a way that obviates the need for code changes:
http.proxyHost #the host name of the proxy server http.proxyPort # the proxy port, defaults to 80 http.nonProxyHosts # allows for specifying host patterns to bypass the proxy
The JVM's proxy uses HTTP CONNECT, which allows the failure flags sidecar route traffic and discovery dependencies (as it provides the traffic destination)
You can additional set HTTPS traffic via these similar configuration values, though path information will not be visible in the access logs.
https.proxyHost https.proxyPort
When run directly, you can supply these runtime options with the '-D' flag, for example:
java -Dhttps.proxyHost=$MY_PROXY_HOSTNAME -Dhttps.proxyPort=$MY_PROXY_PORT program.java
Additional Reading:
https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article