proxy

SOCKS Proxy

A SOCKS proxy operates at the network layer, tunnelling any TCP connection — not just HTTP — making it more versatile than HTTP proxies for scraping diverse protocols.

SOCKS (Socket Secure) is a network protocol that creates a general-purpose TCP tunnel between the client and the SOCKS proxy server. Unlike an HTTP proxy, which only understands HTTP CONNECT tunnelling, a SOCKS proxy can relay any TCP traffic: HTTP, HTTPS, FTP, WebSocket, or custom binary protocols. SOCKS5 also supports UDP traffic and optional username/password authentication.

For web scraping, SOCKS5 proxies are often preferred when the scraper uses libraries that speak directly over TCP rather than via an HTTP proxy setting. They are also used when WebSocket connections must be proxied alongside regular HTTP requests in the same session.

Browser-based scrapers typically route traffic through SOCKS5 proxies by launching the browser with `--proxy-server=socks5://host:port`. This tunnels all browser traffic — including HTTP/2 and QUIC connections — through the proxy, ensuring complete session isolation.

Examples

# Use SOCKS5 proxy with httpx
import httpx

transport = httpx.HTTPTransport(proxy="socks5://user:[email protected]:1080")
with httpx.Client(transport=transport) as client:
    response = client.get("https://target.com")

Related Terms

Extract SOCKS Proxy data from any website

AlterLab returns clean, structured data from any public URL — no scraper infrastructure needed. Start free, no credit card required.

View API docs

Your first scrape.
Sixty seconds.

$1 free balance. No credit card. No SDK.Just a POST request.

terminal
curl -X POST https://api.alterlab.io/v1/scrape \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "formats": ["markdown"]}'

No credit card required · Up to 5,000 free scrapes · Balance never expires

    SOCKS Proxy — Web Scraping Glossary | AlterLab