Skip to main content
Proxy Basics

How to Use SOCKS5 Proxy: Complete Setup Guide [2026]

5 min read

What is a SOCKS5 Proxy?

SOCKS5 (Socket Secure version 5) is an internet protocol that routes network traffic through a proxy server. Unlike HTTP proxies that only handle web traffic, SOCKS5 works at the session layer (Layer 5) of the OSI model, enabling it to handle virtually any type of traffic including TCP, UDP, and ICMP packets.

Key advantages of SOCKS5 proxies include:

    • Protocol agnostic - Works with HTTP, HTTPS, FTP, SMTP, P2P, and gaming protocols
    • UDP support - Essential for streaming, VoIP, and online gaming
    • Authentication options - Supports username/password authentication for security
    • No data modification - Passes traffic without altering packet headers
    • Better performance - Lower overhead compared to VPNs and HTTP proxies

    SOCKS5 Proxy Configuration on Windows

    Windows 10/11 System-Wide Setup

    Windows does not natively support SOCKS5 proxies at the system level. You have two options:

    Option 1: Use a SOCKS5 client application

    1. Download a SOCKS5 client like Proxifier or SocksCap64
    2. Install and launch the application
    3. Add your proxy server: address, port (default 1080), and credentials
    4. Configure which applications should use the proxy
    5. Enable the proxy connection

    Option 2: Configure individual applications

    Most applications support SOCKS5 directly in their network settings. Configure each application separately using the methods described below.

    Windows Registry Method (Advanced)

    For advanced users, you can configure proxy settings via the registry:

    Windows Registry Editor Version 5.00
    

    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings] "ProxyEnable"=dword:00000001 "ProxyServer"="socks=proxy.example.com:1080"

    SOCKS5 Proxy Configuration on macOS

    System Preferences Method

    macOS has native SOCKS5 proxy support:

    1. Open System Preferences (or System Settings on macOS Ventura+)
    2. Click Network
    3. Select your active network connection (Wi-Fi or Ethernet)
    4. Click Advanced (or Details on newer versions)
    5. Go to the Proxies tab
    6. Check SOCKS Proxy
    7. Enter the proxy server address and port
    8. If authentication is required, check the box and enter credentials
    9. Click OK and then Apply

    Terminal Command Method

    You can also configure SOCKS5 proxy via Terminal:

    # Enable SOCKS proxy for Wi-Fi networksetup -setsocksfirewallproxy "Wi-Fi" proxy.example.com 1080

    Enable with authentication

    networksetup -setsocksfirewallproxy "Wi-Fi" proxy.example.com 1080 on username password

    Turn on the proxy

    networksetup -setsocksfirewallproxystate "Wi-Fi" on

    Verify settings

    networksetup -getsocksfirewallproxy "Wi-Fi"

    Disable when done

    networksetup -setsocksfirewallproxystate "Wi-Fi" off

    SOCKS5 Proxy Configuration on Linux

    Environment Variables

    The most common method on Linux is using environment variables:

    # For current session export ALL_PROXY="socks5://proxy.example.com:1080" export all_proxy="socks5://proxy.example.com:1080"

    With authentication

    export ALL_PROXY="socks5://username:password@proxy.example.com:1080"

    Add to ~/.bashrc or ~/.zshrc for persistence

    echo 'export ALL_PROXY="socks5://proxy.example.com:1080"' >> ~/.bashrc source ~/.bashrc

    Using proxychains

    Proxychains is a powerful tool that forces any application to use your SOCKS5 proxy:

    # Install proxychains sudo apt install proxychains4  # Debian/Ubuntu sudo dnf install proxychains-ng  # Fedora sudo pacman -S proxychains-ng  # Arch

    Edit configuration

    sudo nano /etc/proxychains4.conf

    Add at the end of the file:

    socks5 proxy.example.com 1080 username password

    Use with any application

    proxychains4 curl https://api.ipify.org proxychains4 wget https://example.com/file.zip

    GNOME Desktop Settings

    For GNOME-based distributions:

    1. Open Settings
    2. Navigate to Network
    3. Click on Network Proxy
    4. Select Manual
    5. Enter your SOCKS5 Host and Port
    6. Close settings to apply

    Browser-Specific SOCKS5 Configuration

    Firefox Setup

    Firefox has excellent native SOCKS5 support with DNS resolution options:

    1. Open Firefox and go to Settings
    2. Scroll down to Network Settings and click Settings
    3. Select Manual proxy configuration
    4. In the SOCKS Host field, enter your proxy address
    5. Enter the Port (typically 1080)
    6. Select SOCKS v5
    7. Check Proxy DNS when using SOCKS v5 (important for privacy)
    8. Click OK

    Alternatively, configure via about:config:

    network.proxy.socks = proxy.example.com network.proxy.socks_port = 1080 network.proxy.socks_version = 5 network.proxy.socks_remote_dns = true network.proxy.type = 1

    Chrome Setup

    Chrome uses system proxy settings by default, but you can override with command-line flags:

    # Windows chrome.exe --proxy-server="socks5://proxy.example.com:1080"

    macOS

    /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --proxy-server="socks5://proxy.example.com:1080"

    Linux

    google-chrome --proxy-server="socks5://proxy.example.com:1080"

    For a better experience, use a browser extension like FoxyProxy or Proxy SwitchyOmega:

    1. Install the extension from the Chrome Web Store
    2. Click the extension icon and go to Options
    3. Create a new proxy profile
    4. Select SOCKS5 as the protocol
    5. Enter server address and port
    6. Add authentication if required
    7. Save and activate the profile

    Application-Specific SOCKS5 Setup

    Telegram

    1. Open Telegram Settings
    2. Go to Advanced > Connection type
    3. Select Use custom proxy
    4. Choose SOCKS5
    5. Enter server, port, username, and password
    6. Tap Save

    Git

    # Configure Git to use SOCKS5 git config --global http.proxy socks5://proxy.example.com:1080 git config --global https.proxy socks5://proxy.example.com:1080

    With authentication

    git config --global http.proxy socks5://username:password@proxy.example.com:1080

    Remove proxy configuration

    git config --global --unset http.proxy git config --global --unset https.proxy

    SSH over SOCKS5

    # Using netcat (nc) ssh -o ProxyCommand='nc -X 5 -x proxy.example.com:1080 %h %p' user@remote-server

    Add to ~/.ssh/config for persistence

    Host remote-server HostName remote-server.com User username ProxyCommand nc -X 5 -x proxy.example.com:1080 %h %p

    Using SOCKS5 Proxy in Python

    With requests Library

    import requests

    Basic SOCKS5 proxy

    proxies = { 'http': 'socks5://proxy.example.com:1080', 'https': 'socks5://proxy.example.com:1080' }

    With authentication

    proxies = { 'http': 'socks5://username:password@proxy.example.com:1080', 'https': 'socks5://username:password@proxy.example.com:1080' }

    Make request through proxy

    response = requests.get('https://api.ipify.org', proxies=proxies) print(f'Your IP: {response.text}')

    For DNS resolution through proxy, use socks5h://

    proxies = { 'http': 'socks5h://proxy.example.com:1080', 'https': 'socks5h://proxy.example.com:1080' }

    Note: Install the required package: pip install requests[socks] or pip install PySocks

    With aiohttp (Async)

    import aiohttp from aiohttp_socks import ProxyConnector

    async def fetch_with_proxy(): connector = ProxyConnector.from_url('socks5://proxy.example.com:1080')

    async with aiohttp.ClientSession(connector=connector) as session: async with session.get('https://api.ipify.org') as response: ip = await response.text() print(f'Your IP: {ip}')

    Install: pip install aiohttp aiohttp-socks

    With urllib3

    from urllib3.contrib.socks import SOCKSProxyManager
    

    proxy = SOCKSProxyManager('socks5://proxy.example.com:1080') response = proxy.request('GET', 'https://api.ipify.org') print(response.data.decode())

    Using SOCKS5 Proxy with curl

    Basic Usage

    # Using --socks5 flag curl --socks5 proxy.example.com:1080 https://api.ipify.org

    Using --proxy flag with socks5:// prefix

    curl --proxy socks5://proxy.example.com:1080 https://api.ipify.org

    With authentication

    curl --socks5 proxy.example.com:1080 --proxy-user username:password https://api.ipify.org

    Or combined in URL

    curl --proxy socks5://username:password@proxy.example.com:1080 https://api.ipify.org

    DNS Resolution Options

    # Resolve DNS locally (default for --socks5) curl --socks5 proxy.example.com:1080 https://example.com

    Resolve DNS through the proxy (recommended for privacy)

    curl --socks5-hostname proxy.example.com:1080 https://example.com

    Or use socks5h:// protocol

    curl --proxy socks5h://proxy.example.com:1080 https://example.com

    Using .curlrc Configuration

    # Add to ~/.curlrc for persistent configuration proxy = socks5h://proxy.example.com:1080 proxy-user = username:password

    SOCKS5 Authentication Methods

    No Authentication

    The simplest method where the proxy accepts all connections. Only suitable for private networks or IP-whitelisted access:

    socks5://proxy.example.com:1080

    Username/Password Authentication

    The most common authentication method. Credentials are sent in clear text, so use over secure networks:

    socks5://username:password@proxy.example.com:1080

    IP-Based Authentication

    Your IP address is pre-authorized on the proxy server. No credentials needed in configuration:

    # First, whitelist your IP with your proxy provider

    Then use without credentials

    socks5://proxy.example.com:1080

    Comparison Table: SOCKS5 vs Other Proxy Types

    FeatureSOCKS5SOCKS4HTTP/HTTPS
    TCP SupportYesYesYes
    UDP SupportYesNoNo
    AuthenticationYesNoYes
    Remote DNSYesNoVaries
    Protocol SupportAnyTCP onlyHTTP/HTTPS
    PerformanceHighHighMedium
    IPv6 SupportYesNoYes

    Troubleshooting Common Issues

    Connection Refused

    • Verify the proxy server address and port are correct
    • Check if your IP is whitelisted (for IP-authenticated proxies)
    • Ensure the proxy server is running and accessible
    • Test with telnet: telnet proxy.example.com 1080

    Authentication Failed

    • Double-check username and password
    • Ensure special characters in passwords are properly URL-encoded
    • Verify your subscription or access is still active

    Slow Connection

    • Choose a proxy server geographically closer to you
    • Check if the proxy is overloaded; try a different server
    • Verify your local network connection is stable

    DNS Leaks

    • Use socks5h:// instead of socks5:// to route DNS through the proxy
    • In Firefox, enable "Proxy DNS when using SOCKS v5"
    • Test for leaks at dnsleaktest.com

    Security Best Practices

    • Use SOCKS5 over SOCKS4 - SOCKS5 supports authentication and UDP
    • Enable DNS proxying - Prevents DNS leaks that can reveal your activity
    • Choose reputable providers - Free proxies may log your traffic or inject malware
    • Rotate credentials - Change passwords regularly for authenticated proxies
    • Combine with encryption - SOCKS5 does not encrypt traffic; use HTTPS for sensitive data
    • Verify your IP - Always test that the proxy is working with an IP checker

Conclusion

SOCKS5 proxies offer a versatile and efficient way to route your internet traffic through an intermediary server. Their protocol-agnostic nature makes them ideal for a wide range of applications, from web browsing and development to gaming and streaming. By following the configuration guides above for your specific operating system, browser, or application, you can quickly set up SOCKS5 proxy access in 2025. Remember to enable DNS proxying for privacy and choose authenticated proxies from reputable providers for the best security and performance.

Share: