3proxy and Squid: HTTP/SOCKS5 Proxy on VPS with Authorization

calendar_month May 08, 2026 schedule 6 min read visibility 23 views
person
Valebyte Team
3proxy and Squid: HTTP/SOCKS5 Proxy on VPS with Authorization
To create a high-performance proxy server based on Ubuntu, it is optimal to use 3proxy for lightweight SOCKS5 connections or Squid for advanced HTTP/HTTPS traffic caching — renting a VPS with 1 vCPU, 1 GB RAM, and an NVMe drive for $5–10 per month allows you to support up to 1000 simultaneous sessions without delays.

How to choose a SOCKS5 VPS server and prepare the system

Effective 3proxy and Squid configuration begins with choosing the right location and server specifications. For tasks like web scraping, traffic arbitrage, or bypassing regional restrictions, network uptime (99.9% SLA) and low ping to target resources are critical. If you are looking for a DigitalOcean alternative, pay attention to providers offering 1 Gbps channels without strict limits on packets per second (PPS).

Minimum and recommended VPS specifications

  • Minimum (up to 50 users): 1 vCPU, 1 GB RAM, 10 GB SSD.
  • Recommended (scraping, bots): 2 vCPU, 4 GB RAM, NVMe drive for fast Squid log processing.
  • OS: Ubuntu 22.04 or 24.04 LTS (most stable repositories).

Before installing the software, update the package base and install basic build tools, as it is better to compile your own proxy server based on 3proxy from source to get the latest version with IPv6 support.

sudo apt update && sudo apt upgrade -y
sudo apt install build-essential libevent-dev libssl-dev -y

3proxy and Squid setup: step-by-step 3proxy installation

3proxy is a compact and powerful cross-platform proxy server. Unlike the heavy Squid, it consumes minimal resources (just a few megabytes of RAM), making it an ideal choice for a SOCKS5 VPS server. The main advantage of 3proxy is its support for multiple protocols (HTTP, SOCKS, POP3, FTP) within a single config.

Compilation and basic configuration

Download the latest stable version from GitHub and build it:

wget https://github.com/3proxy/3proxy/archive/refs/tags/0.9.4.tar.gz
tar -xvzf 0.9.4.tar.gz
cd 3proxy-0.9.4
make -f Makefile.Linux
sudo mkdir -p /etc/3proxy/bin
sudo cp bin/3proxy /etc/3proxy/bin/
sudo cp scripts/rc.d/proxy.sh /etc/init.d/3proxy

Now, let's create the configuration file /etc/3proxy/3proxy.cfg. It is important to set the correct access permissions (chmod 600) because the config will store user passwords in plain text.

# Run in daemon mode
daemon

# DNS servers (use Google or Cloudflare)
nserver 8.8.8.8
nserver 1.1.1.1
nscache 65536

# Timeouts
timeouts 1 5 30 60 180 1800 15 60

# Login and password authentication
auth strong
users "admin:CL:YourStrongPassword"

# SOCKS5 setup
allow admin
socks -p1080

# HTTP proxy setup
proxy -p8080 -n

Managing limits and port rotation in 3proxy

If you are using your own proxy server for social media or search engines, you might need traffic limits or binding to specific IP addresses. 3proxy allows you to set limits using the bandlim command.

To rotate external IPs (if your VPS has several), use the -e parameter. This is critical for those setting up residential proxies via their own VPS or working with large IPv6 pools.

Looking for a reliable server for your projects?

VPS from $10/mo and dedicated servers from $9/mo with NVMe, DDoS protection, and 24/7 support.

View offers →
# Example of binding to a specific external IP
proxy -p8081 -n -a -e1.2.3.4
proxy -p8082 -n -a -e1.2.3.5

Squid setup: creating an advanced HTTP proxy server

Squid is the industry standard when it comes to an HTTP proxy server. It features a powerful ACL (Access Control Lists) system and can cache content, which reduces bandwidth load. However, Squid configuration is more complex than 3proxy and requires more RAM (at least 256-512 MB for caching needs).

Installation and basic security

Install Squid from the official Ubuntu repositories:

sudo apt install squid apache2-utils -y

To set up authentication, create a password file using the htpasswd utility:

sudo htpasswd -c /etc/squid/passwd proxy_user

Optimizing the squid.conf configuration file

Open /etc/squid/squid.conf. By default, Squid only allows connections from the local host. We need to change this by adding authentication rules.

# Path to the password file
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic realm My Private Proxy
auth_param basic credentialsttl 2 hours

# ACL definitions
acl auth_users proxy_auth REQUIRED
acl localhost src 127.0.0.1/32

# Access permission
http_access allow auth_users
http_access allow localhost
http_access deny all

# Port
http_port 3128

# Anonymity (hiding the client's real IP)
via off
forwarded_for delete
request_header_access X-Forwarded-For deny all
request_header_access From deny all
request_header_access Referer deny all
request_header_access User-Agent deny all

After making changes, restart the service: sudo systemctl restart squid. If you plan to use the server for complex tasks such as bypassing DPI, it might be worth considering more modern protocols, such as the 3x-ui panel with Reality.

Comparing 3proxy and Squid: which one to choose for your tasks?

The choice between these two tools depends on your goals. Google often prefers structured data, so below is a table of characteristics for clarity.

Feature 3proxy Squid
RAM Consumption Very low (5-20 MB) Medium/High (200+ MB) Critical for cheap VPS
SOCKS5 Support Native, excellent Limited (via plugins) 3proxy leads in SOCKS5
Traffic Caching No Yes (HTTP/HTTPS) Squid saves bandwidth
Setup Complexity Simple (one file) High (many directives) 3proxy is faster to launch
Anonymity High "out of the box" Requires header tweaks Both are reliable when configured

Security: IP Whitelist and Brute-force Protection

Once your HTTP proxy server is running, it becomes a target for botnets scanning standard ports (8080, 3128, 1080). To protect your own proxy server, it is recommended to:

  1. Change standard ports: Use random values, for example, 49152–65535.
  2. Configure an IP whitelist: If you have a static IP, allow access only from it.
  3. Use Fail2Ban: This will prevent password brute-forcing for the proxy.

Example of iptables configuration to restrict access by IP:

# Allow SOCKS5 access only from your IP
sudo iptables -A INPUT -p tcp -s YOUR_IP --dport 1080 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 1080 -j DROP

For those using proxies for automated purchases or sneaker copping, having a stable connection is vital. You can read more about this in the article about sneaker bots on VPS.

Using proxies for scraping and rental

Many users set up a SOCKS5 VPS server for the purpose of renting out ports or for large-scale data collection. In this case, your 3proxy and Squid setup should include logging and resource consumption monitoring.

Configuring logging in 3proxy

To track traffic, add the following to 3proxy.cfg:

log /var/log/3proxy/3proxy.log D
logformat "- +_L%t.%. %N.%p %E %U %C:%c %R:%r %O %I %h %T"
rotate 30

This will create a detailed log that can be parsed with Python scripts to generate reports for clients. If you are engaged in web scraping, remember that many sites block data center IPs. In such cases, your VPS-based proxy server acts only as an intermediate link.

Scaling: IPv6 Proxies

Modern VPS often provide a /64 IPv6 subnet. These are millions of addresses that can be used to create an "infinite" proxy pool. 3proxy handles binding thousands of ports to different IPv6 addresses excellently, making it indispensable for SEO specialists.

System Performance Optimization

To ensure your HTTP proxy server can handle high loads, you need to adjust Linux kernel parameters in /etc/sysctl.conf. This is especially important when configuring Squid for high-load projects.

# Increase open files limit
fs.file-max = 100000

# TCP stack optimization
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_tw_reuse = 1
net.core.somaxconn = 4096
net.ipv4.ip_local_port_range = 1024 65535

Apply the changes with the command sudo sysctl -p. Without these tweaks, the server will start dropping packets upon reaching 500-1000 simultaneous connections, leading to "Connection Timeout" errors for clients.

Conclusions

For creating a fast and lightweight proxy server, choose 3proxy, as it consumes 10 times fewer resources and is easier to configure for SOCKS5. If you need deep control over HTTP traffic and caching, use Squid, after optimizing kernel parameters and configuring anonymous headers.

Ready to choose a server?

VPS and dedicated servers in 72+ countries with instant activation and full root access.

Start Now →

Share this post:

support_agent
Valebyte Support
Usually replies within minutes
Hi there!
Send us a message and we'll reply as soon as possible.