# SOCKS5 proxy

A SOCKS5 proxy relays TCP connections at the transport level without understanding the application protocol, so it can carry HTTP, HTTPS, SMTP, custom binary protocols or anything else over TCP. SOCKS5 adds username-password authentication and, optionally, remote DNS resolution and UDP association. It is the protocol to use for tools that are not HTTP clients or that need the proxy to resolve hostnames.


## SOCKS5 versus HTTP proxy

|  | SOCKS5 | HTTP proxy |
| --- | --- | --- |
| Protocols carried | Any TCP | HTTP and HTTPS (CONNECT can tunnel other TCP too) |
| Understands the request | No | Yes for plain HTTP |
| DNS resolution | On the proxy (socks5h) or locally (socks5) | On the proxy for full-URL requests; host name sent in CONNECT |
| Client support | Most tools; some need a library | Universal |


## socks5 versus socks5h

In cURL and Python, `socks5://` resolves the destination hostname on your machine and sends the IP to the proxy; `socks5h://` sends the hostname and lets the exit resolve it. Use `socks5h` to keep DNS queries in the exit's country and to avoid leaking hostnames to your local resolver.

```text
socks5h://USER-cc-us:PASS@res.proxshift.com:9001
```


## How it works at ProxShift

ProxShift gateways speak SOCKS5 on port 9001 with the same credentials and username parameters as HTTP; dedicated addresses on port 8001. UDP ASSOCIATE and BIND are not supported: TCP only.

## Questions

**Is SOCKS5 faster than HTTP?**

Not measurably. Both add one hop; SOCKS5 does slightly less parsing but the network path dominates. Choose by tool support and DNS behaviour, not speed.

Source: https://proxshift.com/glossary/socks5-proxy
