v1.10.82-f67ee7d
Skip to main content
← Back to Hex Proxies

wget Proxy Integration

Use wget with Hex Proxies for quick CLI testing and downloads.

wget Proxy Setup

wget is the standard command-line tool for downloading files and testing HTTP connectivity on Linux and macOS. It supports proxy configuration through environment variables, command-line flags, and the `~/.wgetrc` configuration file. Using wget with Hex Proxies is the fastest way to verify proxy connectivity, test geo-targeting, and download files through residential IPs from the command line.

Environment Variable Configuration

The simplest approach — set environment variables and all wget commands use the proxy:

export http_proxy=http://user:pass@gate.hexproxies.com:8080

# Verify proxy connectivity wget -qO- https://httpbin.org/ip

# Download a file through the proxy wget https://example.com/file.zip ```

Command-Line Proxy Flags

For one-off commands without setting environment variables:

# Use -e to pass proxy settings inline
wget -e use_proxy=yes \
     -e http_proxy=http://user:pass@gate.hexproxies.com:8080 \
     -e https_proxy=http://user:pass@gate.hexproxies.com:8080 \
     https://example.com/page.html

Persistent Configuration via .wgetrc

For regular proxy usage, add settings to `~/.wgetrc`:

use_proxy = on
http_proxy = http://user:pass@gate.hexproxies.com:8080
https_proxy = http://user:pass@gate.hexproxies.com:8080
proxy_user = user
proxy_password = pass

Geo-Targeted Downloads

Test content from specific countries by modifying the proxy username:

# Download as a UK user
export https_proxy=http://user-country-gb:pass@gate.hexproxies.com:8080

# Download as a German user export https_proxy=http://user-country-de:pass@gate.hexproxies.com:8080 wget -qO- https://example.com/pricing ```

Debugging Proxy Connections

Use wget's verbose and debug modes to inspect the proxy connection:

# Verbose output shows proxy handshake

# Save response headers for analysis wget -S --spider https://example.com 2>&1 ```

Common Pitfalls

wget does not handle proxy authentication with special characters in passwords by default. URL-encode special characters in the password, or use the `--proxy-user` and `--proxy-password` flags separately. If wget hangs on HTTPS requests through the proxy, ensure you are using `http://` (not `https://`) in the proxy URL — the proxy handles the TLS connection to the target.

Recursive Downloads Through Proxy

wget's recursive download mode (`-r`) works through proxies for mirroring sites:

wget -r --level=2 --wait=2 -e https_proxy=http://user:pass@gate.hexproxies.com:8080 https://example.com/docs/

Add `--wait=2` to space requests 2 seconds apart, respecting rate limits through the proxy.

Bandwidth and Timeout Considerations

Residential proxies add 200-500ms latency per request. Set wget's timeout values accordingly: `--timeout=30` for the overall request and `--connect-timeout=15` for the initial proxy handshake. For large file downloads through the proxy, the unlimited bandwidth of residential plans means download speed depends on the exit IP's connection quality rather than any proxy-imposed limit.

When to Use wget vs curl

wget excels at recursive downloads and site mirroring through proxies. curl is better for single requests with complex headers, JSON payloads, or API testing. For scripting pipelines, wget's `-q` (quiet) and `-O-` (stdout output) flags integrate cleanly with shell pipelines through the proxy.

Integration Steps

1

Set proxy environment variables

Export http_proxy and https_proxy with your Hex Proxies credentials. Use http:// protocol in the proxy URL even for HTTPS targets.

2

Verify connectivity

Run wget -qO- https://httpbin.org/ip to confirm traffic routes through the proxy and see the exit IP.

3

Test geo-targeting

Modify the proxy username with a country code (e.g., user-country-us) and verify the response reflects the target region.

4

Debug if needed

Use wget -v --debug to inspect the proxy handshake and response headers for troubleshooting connection issues.

Operational Tips

Keep sessions stable for workflows that depend on consistent identity. For high-volume collection, rotate IPs and reduce concurrency if you see timeouts or 403 responses.

  • Prefer sticky sessions for multi-step flows (auth, checkout, forms).
  • Rotate per request for scale and broad coverage.
  • Use timeouts and retries to handle transient failures.

Frequently Asked Questions

Does wget support SOCKS5?

wget does not support SOCKS5 natively. Use tsocks, proxychains, or a SOCKS-to-HTTP bridge to route wget through a SOCKS5 proxy. For most use cases, the HTTP proxy gateway at gate.hexproxies.com:8080 is sufficient.

Why does wget hang on HTTPS requests through the proxy?

Ensure the proxy URL uses http:// not https://. The wget client connects to the proxy over plain HTTP, and the proxy establishes the TLS tunnel to the target. Using https:// in the proxy URL causes a double-encryption issue that hangs.

Can I use wget for recursive site downloads through a proxy?

Yes. Use wget -r with --wait to space requests through the proxy. Add --level to limit crawl depth and avoid excessive bandwidth usage through the residential proxy.

Ready to Integrate?

Start using residential proxies with wget today.