SOCKS and SOCKS5 Proxy: What is It and How to Use It
Tags: proxy, socks
Published: 2022-08-15 12:37:00

SOCKS stands for SOCKet Secure. SOCKS is an internet protocol for exchanging data packets between a client and a server through a third device — a proxy. The two current versions are 4 and 5.

## What is SOCKS Proxy?

The definitive quality of SOCKS is that it is designed to route multiple types of traffic across a wide range of ports.

Most other proxies act on the application level (service, single port). They can route only the type of traffic specific to that service (i.e., HTTP, email, etc.) SOCKS protocols belong at the Sessions layer 5 of the OSI model: by definition, session layers can include several protocols, applications, or services. It makes them a more versatile routing solution than most web proxies typically set up at the services layer (one proxy — one specific service.)

## Use Cases

SOCKS-enabled proxy servers can be used to:

- Same as any [free or paid proxies](https://soax.com/blog/free-vs-paid-proxies-the-pros-cons?utm_source=devto&utm_medium=social&utm_term=post), a SOCKS proxy can be used to circumvent surveillance, restrictions, and geo-blocking. However, SOCKS needs to be combined with another protocol (like Tor) because it is not service specific, and without an added layer, would not “know” what to do with the traffic it processes;

- To expand proxy services functionality beyond HTTP(s) protocol and to add authentication capability;

- Some companies use SOCKS5 servers as a means of authenticating clients for server access or as a proxy server to access the internet safely;

- To build a type of firewall called circuit-level gateways;

- SOCKS5 with SSH can be utilized to monitor and configure the back end of cloud-hosted nodes more securely.


## What is a SOCKS5 Proxy?

There are only two versions of the SOCKS protocol: SOCKS4 and SOCKS5 (technically, also 4a).

The SOCKS5 protocol was originally a security protocol simplifying firewall and authentication implementation. It has existed since 1996 and is outlined in [RFC 1928](https://www.rfc-editor.org/rfc/rfc1928).

The main differences between SOCKs5 and SOCKS4 are:

- SOCKS4 does not support authentication, while SOCKS5 has an extensive authentication functionality;

- SOCKS4 can accommodate only TCP traffic, while SOCKS5 can route both TCP and UPD;

- SOCKS5 supports both IPv4 and [IPv6](https://en.wikipedia.org/wiki/IPv6), SOCKS4 — only IPv4;

- SOCKS5 can use the Secure Shell (SSH) encrypted tunneling method to relay the traffic.


## How Does SOCKS Proxy work?

The SOCKS proxy is an intermediate node or relay that filters and directs the traffic further. Once configured, the SOCKS proxy handles all the back and forward between you (the client) and the server transparently.

If the client is exchanging TCP data, SOCKS forwards the data over the established TCP connection. If the client is exchanging UDP data, the TCP connection might have to be used to establish the initial connection for communication (handshake) because the UDP protocol itself is not suitable for it. After that, TCP is only used for the proxy’s success replies and the client’s instructions on where to send the UDP packets. A separate UDP relay is used to move UDP traffic.

## How is SOCKS Proxy Different from Other Common Proxy Servers?

HTTP proxies are [protocol (application) layer proxies](https://soax.com/blog/free-vs-paid-proxies-the-pros-cons?utm_source=devto&utm_medium=social&utm_term=post): they can only work with HTTP/HTTP(s) traffic. You need to establish a separate connection for each protocol you want to exchange through proxy: for example, emails would have to be set up separately. This means a better connection speed over each one but also a significantly more complicated configuration when you need more than one protocol.

[SOCKS5 proxies](https://soax.com/blog/5-reasons-why-your-business-needs-a-proxy-provider2?utm_source=devto&utm_medium=social&utm_term=post) can work with many traffic types: HTTP, HTTP(s), FTP, POP3, and SMTP. So SOCKS can be used for P2P (peer-to-peer) file transfers, email exchange, and more. You just need to make sure your proxy service provider has all the ports you need open, otherwise the proxies would not be any different from HTTPs.

## Main Benefits of Using SOCKS5 Proxy

**1. Fast Connection for Real-Time Streaming Protocol**

SOCKS5 UDP protocol allows for establishing a fast enough connection for Real-Time Streaming Protocol, Voice over IP, and more. It means you might succeed with video streaming and online gaming as long as the proxy server remains the same.

**2. Fewer errors at the cost of privacy and anonymity**

When a proxy rewrites data headers, it takes extra time and might lead to errors or misrouting. SOCKS5 proxy servers do not rewrite data packet headers; hence the performance improves. This also means that some of your personal information is still exposed to any surveillance program that uses deep analysis and not just looks at the last source’s IP address. If anonymity is important, SOCKS should be used with another protocol on top of it (i.e. Tor network).

**3. Simpler setup**

As long as you have permissions, access the gateway node of the network with SSH protocol. You can now use a single proxy instead of several application-specific ones.

## How to Set Up and Use SOCKS proxy?

[SOCKS protocols](https://www.rfc-editor.org/) are well-documented, and all the information is easily accessible:

- [SOCKS: A protocol for TCP proxy across firewalls:](http://ftp.icm.edu.pl/packages/socks/socks4/SOCKS4.protocol) SOCKS4 — SOCKS Protocol Version 4 (NEC)

- RFC 1928: SOCKS5 — SOCKS Protocol Version 5

- RFC 1929: Username/Password Authentication for SOCKS V5

- RFC 1961: GSS-API Authentication Method for SOCKS Version 5

- RFC 3089: A SOCKS-based IPv6/IPv4 Gateway Mechanism

- [Challenge-Handshake Authentication Protocol for SOCKS V5](https://datatracker.ietf.org/doc/html/draft-ietf-aft-socks-chap)

**How to set up a SOCKS5 SOAX proxy manually on Windows 10:**

1. Go to https://dashboard.soax.com/proxy. It is your SOAX Dashboard> “Proxies” item in the menu. On the page, find the “Quick Access” table. Decide whether to use the Login and Pass authentication method or an IP one (if IP, you need to whitelist your own IP, it is easily done via the button in the top left corner of the same page). Configure the geotargeting you want. Now you have all the details you need for your next steps.

2. Go to “Settings” > “Network & Internet” > “Proxy.”

3. Under “Manual proxy setup,” toggle the “On” button.

4. Fill in details about your proxy server.

5. Click “Save.”



![How to set up a SOCKS5 SOAX proxy manually on Windows 10](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7w8zpvmu8ub61xak1u3o.png)

**How to set up a SOCKS5 SOAX proxy manually on macOS:**

1. Go to https://dashboard.soax.com/proxy. It is your SOAX Dashboard > “Proxies” item in the menu. On the page, find the “Quick Access” table. Decide whether to use the Login and Pass authentication method or an IP one (if IP, you need to whitelist your own IP, it is easily done via the button in the top left corner of the same page). Configure the geotargeting you want. Now you have all the details you need for your next steps.

2. Go to “System Preferences” > “Network” > “Advanced” > “Proxies.”

3. Select the “SOCKS proxy” protocol in the menu.

4. Type your proxy server address.

5. Click “OK.”

A SOCKS proxy is a versatile and fast proxy of layer 5 of the OSI model, useful for multiple types of traffic. SOCKS5 proxy is an excellent improvement to version 4. In your SOAX Dashboard, you can easily access and configure a SOCKS5 [residential proxy network](https://soax.com/blog/5-reasons-why-your-business-needs-a-proxy-provider2?utm_source=devto&utm_medium=social&utm_term=post) for your own needs.

This post was originally published on [SOAX blog](https://soax.com/blog/socks-and-socks5-proxy-what-is-it-and-how-to-use-it?utm_source=devto&utm_medium=social&utm_term=post
).