Network Proxy Settings
This page covers outbound HTTP(S) proxies used to reach external services. It is separate from Specmatic's proxy feature for recording and forwarding API traffic.
When Specmatic runs in an environment that requires an HTTP proxy, configure it using JVM system properties or environment variables. These settings support license, telemetry, and utilization requests, including linting and report publishing to Specmatic Insights.
JVM system properties
Set the proxy host and port for each protocol:
java \
-Dhttp.proxyHost=proxy.example.com \
-Dhttp.proxyPort=3128 \
-Dhttps.proxyHost=proxy.example.com \
-Dhttps.proxyPort=3128 \
-jar specmatic.jar
For the Specmatic Docker image, pass the properties through JAVA_OPTS:
docker run \
-e JAVA_OPTS='-Dhttp.proxyHost=proxy.example.com -Dhttp.proxyPort=3128 -Dhttps.proxyHost=proxy.example.com -Dhttps.proxyPort=3128' \
specmatic/specmatic
For the Specmatic NPM package, set JAVA_OPTS before invoking it:
export JAVA_OPTS='-Dhttp.proxyHost=proxy.example.com -Dhttp.proxyPort=3128 -Dhttps.proxyHost=proxy.example.com -Dhttps.proxyPort=3128'
npx specmatic
Proxy environment variables
Specmatic reads standard proxy environment variables. The lowercase forms also work with Git when Specmatic accesses HTTP(S) remotes, so they are used in these examples:
export http_proxy=http://proxy.example.com:3128
export https_proxy=http://proxy.example.com:3128
export no_proxy=localhost,.internal.example
no_proxy accepts a comma-separated list of hosts or domains; a domain entry also bypasses the proxy for its subdomains. * bypasses the proxy for all hosts.
These variables may also be needed when your Specmatic configuration requires access to a Git repository behind a proxy. Git's HTTP transport uses curl's proxy environment variables. Set no_proxy for Git hosts that should be reached directly.
JVM proxy properties take precedence over environment variables for their respective protocol. Contact your IT administrator for the correct proxy address and port.
Note: Specmatic does not support NTLM (NT LAN Manager) authentication for proxies. If your corporate environment uses NTLM, set up an intermediary proxy such as CNTLM or Px to handle NTLM and provide basic/digest authentication or no authentication to Specmatic.