Skip to main content

Outbound HTTP proxy

When the only way from a worker to the web is an HTTP proxy, set the usual environment variables on the SolidPing process (the server, or the private-location agent that runs the checks):

VariableMeaning
HTTP_PROXYProxy for http:// (and ws://) targets
HTTPS_PROXYProxy for https:// (and wss://) targets. It does not fall back to HTTP_PROXY: set both when one proxy does everything
NO_PROXYComma-separated hosts that skip the proxy: a domain (acme.com also matches its subdomains, .acme.com only them), an IP, a CIDR (10.0.0.0/8), host:port, or * for no proxy at all

The lower-case variants (http_proxy, …) work too, read the way Go's net/http reads them. There is no SolidPing setting of its own. Loopback and localhost targets never go through the proxy.

Credentials go in the proxy URL:

HTTPS_PROXY=http://monitoring:s3cret@proxy.acme.com:3128
HTTP_PROXY=http://monitoring:s3cret@proxy.acme.com:3128
NO_PROXY=.internal.acme.com,10.0.0.0/8

The proxy is per process: each private-location agent reads its own environment.

Only under a permissive egress policy​

Checks use the proxy only when the egress policy is not enforcing, i.e. when the process allows private targets (SP_EGRESS_ALLOW_PRIVATE=true, the default on self-hosted instances and on agents). Under an enforcing policy the proxy is ignored for checks: the policy must see the address a check connects to in order to refuse a non-public one, and a proxy would hide it. SolidPing then logs a warning at startup:

HTTP_PROXY / HTTPS_PROXY are set but checks ignore them: the egress policy is enforcing ...

Set SP_EGRESS_ALLOW_PRIVATE=true to send checks through the proxy.

Which checks go through it​

CheckThrough the proxy
HTTP, Prometheus, crawl, HTTP/1.1 and HTTP/2 probesYes, including verifySsl: false and a pinned ipVersion (the pin then applies to the connection to the proxy)
WebSocketYes
JavaScript http / fetch and websocketYes
Domain (RDAP lookups)Yes
BrowserYes, see below
HTTP/3No: QUIC is UDP, which an HTTP proxy cannot carry
TCP, and the JavaScript tcp socketsNo (SOCKS5 support is tracked separately)
UDP, ICMP (ping), DNSNo
Tunneled checks (tunnelCheckUid)No: the SSH tunnel is their route

The worker's own calls to its headless Chrome (SP_CHECKERS_BROWSER_CDP_URL) never go through the proxy, whatever NO_PROXY says.

Browser checks​

Chrome cannot take proxy credentials from --proxy-server or from the environment, so SolidPing does it for it: it hands Chrome the proxy without its credentials (per browser context on a remote Chrome, on the command line of a Chrome it starts itself), turns NO_PROXY into Chrome's bypass list, and answers the proxy's 407 Proxy Authentication Required with the credentials from the URL. Those credentials only ever answer a challenge from the configured proxy, never a website's own authentication, and a page's Basic credentials are never sent to the proxy.

The proxy must be reachable from the browser: with a browser sidecar container, use an address the sidecar can resolve (not localhost).

A navigation that fails before any response says why, e.g.:

  • could not connect to the HTTP proxy (proxy.acme.com:3128)
  • the HTTP proxy refused its credentials (proxy proxy.acme.com:3128)
  • could not connect to acme.com through the HTTP proxy proxy.acme.com:3128
  • no response from acme.com before the timeout, the connection was never established