SOCKS4
SOCKS4 is an old version of the SOCKS protocol: it relays connections but has no password login.
Updated · Prokso editorial team
SOCKS4 relays data between a program and a server just like SOCKS5, but it can do much less. It has no username and password check and no support for IPv6.
In basic SOCKS4, the program itself has to resolve the site's address. The SOCKS4a extension lets it pass the site name to the proxy, but it is not supported everywhere.
Today SOCKS4 is found mostly in old programs and in lists of free proxies. Modern services work over SOCKS5 or HTTP.
Prokso works with HTTP, HTTPS and SOCKS5. If a program offers a choice between SOCKS4 and SOCKS5, choose SOCKS5.
What a SOCKS4 request looks like
The program sends one short packet: protocol version 4, the command, the site's port, its IPv4 address and a user ID field that ends with a zero byte. The CONNECT command opens a connection to the site, while BIND waits for an incoming one. The server answers with code 90 if the request is granted and 91 if it is rejected.
The user ID field is often mistaken for a login. It is not a password check: the field only carries a name, and the protocol has no place for a password.
How SOCKS4a passes the site name
In SOCKS4a the program puts a special address such as 0.0.0.1 in place of the IP, and after the user ID it adds the site name. The proxy sees this and resolves the name itself. If the server knows only plain SOCKS4, such a request is rejected.
| Feature | SOCKS4 | SOCKS4a | SOCKS5 |
|---|---|---|---|
| Username and password | no | no | yes |
| Site name instead of IP | no | yes | yes |
| IPv6 | no | no | yes |
What to do if a program offers SOCKS4
Prokso offers SOCKS5, not SOCKS4: port 824 with a new IP per request and ports 10000-20000 with a sticky IP. If you enter these ports as SOCKS4, the server receives a packet with a different version number, and the connection is not established. If a program knows only SOCKS4, choose its HTTP proxy option with port 823 instead, or see the SOCKS5 proxies page.
Not sure which protocol a line works with? Paste it into the proxy checker: it shows the protocol of a working line. In curl, SOCKS4 and SOCKS4a are set with the schemes socks4:// and socks4a://, and SOCKS5 with socks5:// and socks5h://. A mixed-up scheme in the line gives the same error as the wrong proxy type in the settings.
FAQ
Can SOCKS4 be used with a password?
No, SOCKS4 has no password login. You can only use it with access by IP, and only if the service supports this protocol.
Is SOCKS5 compatible with SOCKS4?
The protocols are different. Some servers accept both, but the program has to state explicitly which one it uses.
Residential $1.59, mobile $2.50, datacenter $0.65 per GB
Sign up in a minute, get access right after payment.