reference Environment variables
HTTP_PROXY
- Also spelled
http_proxy- Value
- a proxy URL with a scheme, such as
http://proxy.example.com:3128 - See also
ALL_PROXY,HTTPS_PROXY
The proxy for downloads over plain http, as HTTPS_PROXY is for https. It does not apply to https downloads, which include the registry and most rule URLs. To send all downloads through a proxy, set both variables, or ALL_PROXY.
The lowercase http_proxy is also read; when both are set, HTTP_PROXY takes precedence. The variable has no OPENGREP_ form.
Examples
Which downloads it covers
The host proxy.invalid does not exist, so a download through the proxy fails when Opengrep resolves the proxy.
app.py
eval(1)Command and result
$ HTTP_PROXY=http://proxy.invalid:3128 opengrep scan --config http://example.invalid/rules.yaml app.py 2>&1 | grep 'Failed to download'
error Failed to download config from http://example.invalid/rules.yaml: Failure: resolution failed: name resolution failed
$ HTTP_PROXY=http://proxy.invalid:3128 opengrep scan --config https://example.invalid/rules.yaml app.py 2>&1 | grep 'Failed to download'
error Failed to download config from https://example.invalid/rules.yaml: Failure: TLS to non-TCP currently unsupported: host=example.invalid endp=(Unknown "name resolution failed")The http download went to the proxy; the https one did not use it and failed on example.invalid itself.