Explained
SOCKS5 is a transport-layer proxy protocol defined in RFC 1928. Unlike an HTTP proxy, which understands and parses HTTP requests and responses, a SOCKS5 proxy operates at a lower level: it forwards raw TCP or UDP packets between you and the destination without inspecting or modifying the payload. This means a SOCKS5 proxy can carry any protocol that runs over TCP or UDP, not just web traffic.
SOCKS5 is the modern version of the SOCKS proxy protocol, adding support for IPv6, UDP forwarding, and authentication methods (no auth, username/password, GSS-API). Most residential and ISP proxy providers expose their endpoints over both HTTP and SOCKS5 so clients can pick whichever protocol fits their stack.
For web scraping over HTTPS, an HTTP CONNECT proxy and a SOCKS5 proxy behave nearly identically — both end up tunneling encrypted TCP traffic. The differences become meaningful when your client uses non-HTTP protocols (FTP, SMTP, IRC, BitTorrent, gaming) or when you specifically need UDP support.
How It Works
When your client connects to a SOCKS5 proxy, it sends a small handshake specifying the auth method, then a CONNECT command with the destination host and port. The proxy opens a TCP connection to that destination and from that point on simply relays bytes between client and destination. There's no HTTP layer awareness — the proxy doesn't read the URL, headers, or response body.
This transport-layer transparency is why SOCKS5 works for any TCP-based protocol. UDP support uses a separate UDP ASSOCIATE flow where the client sends UDP datagrams to the proxy and the proxy forwards them to the target. Authentication, if used, happens once during the initial handshake and applies to the entire session.