scurl supports comprehensive network configuration options for corporate environments, proxies, and special network setups.
# Use HTTP proxy
scurl --proxy http://proxy.example.com:8080 https://example.com/install.sh
# Custom timeout and retries
scurl --timeout 60 --retries 5 https://slow-server.com/script.sh
# Ignore SSL errors (insecure!)
scurl --insecure https://self-signed.example.com/install.sh
# Custom headers
scurl -H "Authorization: Bearer token123" -H "X-Custom: value" https://api.example.com/script.sh
# Use system proxy + custom User-Agent
scurl --system-proxy -A "MyApp/1.0" https://example.com/install.shSet HTTP/HTTPS proxy for all requests.
# HTTP proxy
scurl --proxy http://proxy.company.com:8080 URL
# HTTPS proxy
scurl --proxy https://secure-proxy.company.com:8443 URL
# Proxy with authentication
scurl --proxy http://user:pass@proxy.company.com:8080 URL
# Environment variable (alternative)
export HTTPS_PROXY=http://proxy.company.com:8080
scurl URLUse system proxy settings (enabled by default in most environments).
scurl --system-proxy URLDisable all proxy settings, even if environment variables are set.
# Ignore HTTP_PROXY and HTTPS_PROXY env vars
scurl --no-proxy URLSet request timeout in seconds (default: 30).
# 60 second timeout
scurl --timeout 60 URL
# Fast timeout for quick check
scurl --timeout 5 URLNumber of retry attempts on network failure (default: 3).
# Retry up to 5 times
scurl --retries 5 URL
# No retries (fail immediately)
scurl --retries 1 URL
# More retries for unreliable networks
scurl --retries 10 URLRetries use exponential backoff with jitter: 1s, 2s, 4s, 8s... capped at 30s.
Maximum HTTP redirects to follow (default: 10).
# Allow more redirects
scurl --max-redirects 20 URL
# Disable redirects entirely
scurl --max-redirects 0 URLDisable SSL certificate verification (dangerous!).
# Accept self-signed certificates
scurl --insecure https://self-signed.local/script.shWhen to use:
- Internal corporate servers with self-signed certs
- Development/testing environments
- Never in production!
Add custom HTTP headers. Can be used multiple times.
# Single header
scurl -H "Authorization: Bearer token123" URL
# Multiple headers
scurl \
-H "Authorization: Bearer token123" \
-H "X-API-Key: secret456" \
-H "Accept: application/json" \
URLFormat: Key: Value (note the colon and space)
Common use cases:
# API authentication
scurl -H "Authorization: Bearer $TOKEN" URL
# Custom accept type
scurl -H "Accept: text/plain" URL
# Request ID for tracing
scurl -H "X-Request-ID: $REQUEST_ID" URLSet custom User-Agent header.
# Custom user agent
scurl -A "MyCompany-DeployBot/2.0" URL
# Mimic browser
scurl -A "Mozilla/5.0 (compatible)" URLDefault: scurl/<current-version> (e.g. scurl/0.4.1)
scurl respects standard proxy environment variables:
# HTTPS proxy (preferred)
export HTTPS_PROXY=http://proxy.example.com:8080
# HTTP proxy (fallback)
export HTTP_PROXY=http://proxy.example.com:8080
# No proxy for certain domains
export NO_PROXY=localhost,127.0.0.1,.local
# Use scurl normally - proxy is auto-detected
scurl https://example.com/install.shPrecedence:
--proxyflag (highest priority)HTTPS_PROXYenvironment variableHTTP_PROXYenvironment variable- System proxy settings
Override with flags:
# Ignore env vars
scurl --no-proxy URL
# Use different proxy
scurl --proxy http://other-proxy.com:8080 URL# Set proxy in your shell profile (~/.bashrc or ~/.zshrc)
export HTTPS_PROXY=http://proxy.corporate.com:8080
export HTTP_PROXY=http://proxy.corporate.com:8080
# Or use flag each time
alias scurl='scurl --proxy http://proxy.corporate.com:8080'# Embed credentials in proxy URL
scurl --proxy http://username:password@proxy.com:8080 URL
# Or use environment variable
export HTTPS_PROXY=http://username:password@proxy.com:8080# Accept internal CA (insecure flag)
scurl --insecure https://internal-server.corp/script.sh
# Better: Add corporate CA to system trust store instead# Internal API requiring special headers
scurl \
-H "X-Corp-Auth: $CORP_TOKEN" \
-H "X-Environment: production" \
https://internal-api.corp/deploy.shAll network options can be combined:
scurl \
--proxy http://proxy.company.com:8080 \
--timeout 60 \
--retries 5 \
--insecure \
-H "Authorization: Bearer $TOKEN" \
-H "X-Request-ID: $ID" \
-A "DeployBot/1.0" \
--max-redirects 20 \
https://example.com/install.sh# Try with increased timeout
scurl --timeout 60 --retries 5 URL# Check proxy is accessible
curl -x http://proxy.example.com:8080 https://google.com
# Try without proxy
scurl --no-proxy URL
# Check environment variables
echo $HTTPS_PROXY
echo $HTTP_PROXY# Temporarily bypass (testing only!)
scurl --insecure URL
# Better: Add CA certificate to system trust store
# macOS: Keychain Access
# Linux: /etc/ssl/certs/
# Windows: Certificate Manager# Increase timeout for slow networks
scurl --timeout 120 URL
# Infinite timeout (not recommended)
scurl --timeout 999999 URL# Increase redirect limit
scurl --max-redirects 20 URL
# Check for redirect loops
curl -v URL 2>&1 | grep Location# GitHub Actions
- name: Install tool with scurl
env:
HTTPS_PROXY: ${{ secrets.CORPORATE_PROXY }}
run: |
scurl --auto-execute https://example.com/install.shENV HTTPS_PROXY=http://proxy.company.com:8080
RUN scurl https://example.com/install.shenv:
- name: HTTPS_PROXY
value: "http://proxy.company.com:8080"
- name: NO_PROXY
value: "localhost,127.0.0.1,.svc.cluster.local"# Test direct connection
time scurl --no-proxy URL
# Test proxy 1
time scurl --proxy http://proxy1.com:8080 URL
# Test proxy 2
time scurl --proxy http://proxy2.com:8080 URL
# Compare speeds-
Increase retries for unreliable networks
scurl --retries 10 URL
-
Shorter timeout for quick failures
scurl --timeout 10 URL
-
Disable redirects for speed
scurl --max-redirects 0 URL
-
Use proxy for caching
scurl --proxy http://caching-proxy.local:3128 URL
- Using
--proxywith trusted corporate proxy - Setting reasonable
--timeoutvalues - Custom
--headerfor authentication --retriesfor reliability
--insecure(disables SSL verification)- Proxy with embedded credentials (use env vars instead)
- Very long timeouts (can hang builds)
- Too many retries (can slow down failures)
--insecurein production- Proxy credentials in CI logs
- Disable redirects without understanding impact
- Zero timeout (will always fail)
scurl --proxy http://proxy.company.com:8080 \
https://raw.githubusercontent.com/org/repo/main/install.shscurl -H "Authorization: Bearer $API_TOKEN" \
https://api.company.com/scripts/deploy.shscurl --timeout 120 --retries 10 \
https://slow-server.example.com/script.shscurl --insecure \
https://internal-server.corp/install.shscurl \
--timeout 300 \
--retries 10 \
--max-redirects 50 \
--system-proxy \
URL