Skip to content
Get Started

SOCKS5 Proxy Setup: curl, Python, Node.js, Proxifier and AdsPower (Tested)

Team CleanProxies
13 Min Read

To set up a SOCKS5 proxy you need four things: the proxy host (IP), the port, a username and a password. Then you point your tool at it with the socks5h:// scheme, so DNS is resolved by the proxy and not by your own machine: curl -x socks5h://USER:PASS@HOST:PORT https://example.com. With CleanProxies SOCKS5 ISP proxies, you get those four values by switching your ISP plan to SOCKS5 in the dashboard; your username and password stay the same. This guide shows that switch and then the setup for curl, Python, Node.js, Proxifier and AdsPower: pick the section for your tool. Every command was run on 4 November 2026 against a local SOCKS5 test server with username and password login, and the guide lists the errors we reproduced with the fix for each.

TL;DR

  • Use socks5h://, not socks5://, unless you have a reason to resolve DNS locally. In our test, curl and Python with socks5:// sent the proxy an IP address and socks5h:// sent the hostname, so only the second lets the proxy do the DNS lookup.

  • Python needs one extra package: pip install "requests[socks]". Without it, requests fails with Missing dependencies for SOCKS support.

  • Chrome's own proxy settings can't send a SOCKS5 username and password. Use Proxifier, an antidetect browser such as AdsPower, or keep the plan in HTTP mode for browser work.

  • CleanProxies is the best place to get SOCKS5 proxies: dedicated static ISP IPs on Tier-1 US carrier ASNs, as low as $0.75/IP, unlimited bandwidth and threads, and a $4.99 trial to test the setup first.

SOCKS5 setup at a glance

ToolWhere the proxy goesScheme / settingDNS on the proxy?
CleanProxies dashboardProxy Manager → ISP plan → auth type SOCKS5Same IP:PORT:USER:PASS list, now speaking SOCKS5n/a
curl-x flagsocks5h://USER:PASS@HOST:PORTYes with socks5h
Python requestsproxies={...}socks5h://... + pip install "requests[socks]"Yes with socks5h
Node.jssocks-proxy-agentnew SocksProxyAgent("socks5h://...")Yes with socks5h
ProxifierProfile → Proxy Servers → AddProtocol "SOCKS Version 5", authentication onProfile → Name Resolution
AdsPowerNew profile → ProxyProxy type "Socks5", host, port, user, passHandled by the browser profile
Chrome (system settings)OS proxy settingsNo SOCKS5 username/password supportUse HTTP mode or a tool above

What SOCKS5 is, in two minutes

SOCKS5 is a general-purpose proxy protocol defined in RFC 1928. Your app opens a TCP connection to the proxy, logs in, and asks it to connect to a target host and port. After that, the proxy just passes bytes in both directions. It doesn't read or rewrite HTTP headers, so it works for HTTPS, databases, mail clients, game launchers and any other TCP app that has a SOCKS setting.

Username and password login for SOCKS5 is a separate standard, RFC 1929. That's what CleanProxies ISP proxies use in SOCKS5 mode. For a deeper comparison of the two protocols, read SOCKS5 vs HTTP proxies.

socks5 vs socks5h: the one letter that matters

When your app asks a SOCKS5 proxy to connect somewhere, it can send the destination in two ways:

SchemeWhat the proxy receivesWho resolves DNSWhen to use it
socks5://An IP address (address type 0x01 for IPv4, 0x04 for IPv6)Your machineRarely: only if you must resolve locally
socks5h://The hostname, e.g. example.com (address type 0x03)The proxyAlmost always, when you connect to a hostname

This is how curl, Python requests and Node's socks-proxy-agent read the two schemes; other tools use a checkbox instead (Proxifier and Firefox, below).

We checked this ourselves rather than trusting the docs. We ran a minimal SOCKS5 server on our own machine (RFC 1928 with RFC 1929 username/password login) that logged the address type of every connection request; it measures client behaviour, not the speed of any commercial proxy. curl and Python with socks5:// both sent an IPv4 address: the DNS lookup had already happened on the client, through the client's own resolver. With socks5h://, the server received the domain name example.com and resolved it itself. With a proxy, socks5h means the lookup is done by the proxy's resolver instead of your laptop's or your ISP's, so your own resolver never sees the hostnames you visit. The curl documentation describes the same split.

Our SOCKS5 test on 4 Nov 2026: curl 7.68 and Python requests 2.34.2 with PySocks 1.7.1 against a local SOCKS5 test server with username and password login. Host and credentials replaced with placeholders. Screenshot: CleanProxies test terminal, 4 Nov 2026.

Step 1: switch your CleanProxies ISP plan to SOCKS5

CleanProxies ISP and ISP Subnet plans support three ways to log in. You pick one per plan in the dashboard:

Auth type in the dashboardProxy line formatProtocol
User PassIP:PORT:USER:PASSHTTP(S)
IP Port (IP whitelist, 1–20 IPv4 addresses)IP:PORTHTTP(S)
SOCKS5IP:PORT:USER:PASSSOCKS5 with the same username and password
  1. Log in and open Proxy Manager → ISP (or ISP Subnet).

  2. Open your plan and select SOCKS5 in the auth type switch.

  3. Wait for the confirmation. The change is applied on the proxy servers and can take a minute or two.

  4. Copy the proxy list again. Each line is IP:PORT:USER:PASS, with your existing username and password (letters and digits only).

  5. To go back to plain HTTP, switch the plan back to User Pass.

Good to know:

  • The switch applies to the whole plan, so one plan runs either HTTP or SOCKS5 at a time. If you need both, buy two plans and set one to each mode.

  • SOCKS5 mode always uses username and password. IP whitelisting is the HTTP-only "IP Port" mode.

  • SOCKS5 is for ISP and ISP Subnet plans. Rotating residential and mobile proxies connect through an HTTP(S) gateway with username and password, so the SOCKS5 steps below don't apply to them: use them as HTTP proxies (http://USER:PASS@HOST:PORT in curl and Python, HTTPS as the Proxifier protocol). Our curl, Python and Node.js proxy guide has the HTTP versions.

Need to reformat a list for another tool (for example USER:PASS@IP:PORT)? Paste it into the free proxy list formatter.

Step 2: test the proxy before you wire it into anything

Paste a line into the free proxy checker as socks5://USER:PASS@IP:PORT. It accepts HTTP(S) and SOCKS5 and shows which proxies work, how long each takes to respond, and the IP address websites will see. If the proxy works there but not in your app, check the app's proxy settings first (scheme, port, credentials), then local firewalls and the target site itself.

The free proxy checker accepts up to ten HTTP(S) or SOCKS5 proxies, one per line; the example uses a documentation IP. Screenshot: cleanproxies.com/tools/proxy-checker, 4 Nov 2026.

Set up SOCKS5 in curl

curl has built-in SOCKS5 support. The cleanest form puts everything in one URL:

curl -x socks5h://USER:PASS@HOST:PORT https://api.ipify.org

The same thing with separate flags. --socks5-hostname is the flag form of socks5h:

curl --socks5-hostname HOST:PORT --proxy-user USER:PASS https://api.ipify.org

Both returned HTTP 200 in our test. The response body is the IP that websites see: one of your dedicated ISP IPs. To make curl calls in a shell session use the proxy, export it once:

export ALL_PROXY="socks5h://USER:PASS@HOST:PORT"
curl https://api.ipify.org

ALL_PROXY is the fallback: if HTTPS_PROXY or HTTP_PROXY is also set, curl uses those for that scheme, and hosts in NO_PROXY skip the proxy. The -x flag on the command line beats all of them.

More curl patterns (timeouts, headers, retries) are on our curl integration page.

Set up SOCKS5 in Python (requests)

requests speaks SOCKS through the PySocks package, which isn't installed by default:

pip install "requests[socks]"
import requests

PROXY = "socks5h://USER:PASS@HOST:PORT"
proxies = {"http": PROXY, "https": PROXY}

r = requests.get("https://api.ipify.org?format=json", proxies=proxies, timeout=15)
print(r.status_code, r.json())

Set both the http and https keys. If you only set http, HTTPS requests skip the proxy and go out from your own IP. We ran this code with requests 2.34.2 and PySocks 1.7.1: socks5 and socks5h both returned 200. Before installing PySocks, the same script failed at once with requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support. The requests documentation covers the same setup.

To spread work across several dedicated IPs, keep a list and pick one per session or per account:

import random, requests

PROXIES = [
    "socks5h://USER:PASS@IP1:PORT",
    "socks5h://USER:PASS@IP2:PORT",
    "socks5h://USER:PASS@IP3:PORT",
]

def session_for(account_index: int) -> requests.Session:
    proxy = PROXIES[account_index % len(PROXIES)]  # same account -> same IP every time
    s = requests.Session()
    s.trust_env = False  # ignore HTTP(S)_PROXY / ALL_PROXY from the environment
    s.proxies = {"http": proxy, "https": proxy}
    return s

trust_env = False matters: without it, proxy environment variables on the machine can override the session's proxies and break the account-to-IP mapping.

Static ISP IPs work best this way: one account or one job always uses the same IP. For scraping that needs a new IP on every request, use rotating residential proxies over HTTP instead; see how to rotate proxies in Python.

Set up SOCKS5 in Node.js

Node's built-in http/https modules don't speak SOCKS. Add the socks-proxy-agent package (we tested version 10.1.0 on Node 24):

npm install socks-proxy-agent
const { SocksProxyAgent } = require("socks-proxy-agent");
const https = require("https");

const agent = new SocksProxyAgent("socks5h://USER:PASS@HOST:PORT");

https.get("https://api.ipify.org", { agent }, (res) => {
  let body = "";
  res.on("data", (c) => (body += c));
  res.on("end", () => console.log(res.statusCode, body));
});

It returned 200 through our test server, and the server log showed the hostname arriving (DNS on the proxy side). The same agent works with axios (httpAgent and httpsAgent) and with node-fetch.

Send any Windows or macOS app through SOCKS5 with Proxifier

Proxifier sends apps that have no proxy setting through a proxy. That includes desktop browsers, launchers and trading tools.

Proxifier setup summary for static ISP proxies. Screenshot: cleanproxies.com/integrations/proxifier, 4 Nov 2026.
  1. Profile → Proxy Servers → Add. Enter the IP and port from your SOCKS5 line.

  2. Protocol: SOCKS Version 5.

  3. Tick Authentication and enter your username and password.

  4. Click Check to run Proxifier's built-in test, then OK.

  5. Profile → Proxification Rules → Add. List the apps (for example chrome.exe; firefox.exe) and choose your new proxy as the action.

  6. Profile → Name Resolution. Choose to resolve hostnames through the proxy. This is Proxifier's version of socks5h.

Full walkthrough with screenshots: Proxifier integration guide.

Set up SOCKS5 in AdsPower (and other antidetect browsers)

Antidetect browsers set the proxy per profile, so each account gets its own dedicated IP:

  1. New Profile → Proxy.

  2. Proxy type: Socks5.

  3. Enter the host (IP), port, proxy username and proxy password from one line of your list.

  4. Click Check Proxy. AdsPower shows the exit IP and its location. Make sure it's the IP you expected before you save the profile.

  5. Repeat with a different line for each profile. Never share one IP across unrelated accounts.

Step-by-step with screenshots: AdsPower integration guide. Multilogin, GoLogin, Dolphin Anty and Octo Browser use the same four fields; see our antidetect browser proxy guide.

What about Chrome, Firefox and headless browsers?

  • Chrome / Edge use the operating system's proxy settings or the --proxy-server flag. Neither can send a SOCKS5 username and password. With a CleanProxies plan in SOCKS5 mode, use Proxifier or an antidetect browser in front of Chrome. Or keep the plan in User Pass (HTTP) mode, which Chrome handles with a login prompt or an extension.

  • Firefox has its own SOCKS v5 setting and a "Proxy DNS when using SOCKS v5" checkbox (its version of socks5h). Its settings page has no field for a SOCKS5 password, but proxy extensions can supply SOCKS5 credentials through Firefox's proxy API, so Firefox with a proxy extension is one browser route that works with SOCKS5 mode.

  • Playwright, Puppeteer and Selenium with Chromium: for login-protected proxies, the reliable path is HTTP mode with the username and password in the proxy settings. Our Python, Playwright and Puppeteer guide shows the code.

That's why many buyers keep one plan in HTTP mode for browsers and automation, and a second plan in SOCKS5 mode for apps and scripts.

Troubleshooting: the errors we reproduced

We triggered the first four on purpose against our local test server; the last two are the usual causes we see when the tests pass but an app still misbehaves:

ErrorWhat it meansFix
curl: (7) User was rejected by the SOCKS5 server (1 1).Wrong username or passwordCopy the credentials again from the dashboard. Passwords are letters and digits only, so a stray space or symbol means a copy error
curl: (7) No authentication method was acceptable.You sent no credentials; the proxy requires themAdd USER:PASS@ to the URL or use --proxy-user
curl: (56) Proxy CONNECT abortedYou used http:// against a SOCKS5 portUse socks5h://, or switch the plan back to User Pass for HTTP
InvalidSchema: Missing dependencies for SOCKS supportPySocks isn't installedpip install "requests[socks]"
DNS leak test shows your own resolversocks5:// (or proxy DNS off) resolved hostnames on your machineChange to socks5h:// or turn on proxy DNS in your tool
Timeouts right after switching auth typeThe change hasn't applied on the server yetWait a minute or two, then copy the list again

For HTTP-side errors like 407, 403 and 429, see how to fix proxy errors.

Key stats

  • SOCKS5 with username and password does not encrypt anything: RFC 1929 sends the login in clear text, and only the traffic inside your HTTPS connection is encrypted. Use HTTPS targets and keep credentials out of shared logs.

  • SOCKS5 has been a standard since March 1996 (RFC 1928). Username/password login is a separate standard, RFC 1929. It allows up to 255 bytes each for the username and password.

  • Port 1080 is the IANA-registered port for SOCKS (IANA service registry). Commercial proxies often use other ports, so always copy the port from your list.

  • A SOCKS5 request names its target in one of three address types: IPv4 (0x01), domain name (0x03) or IPv6 (0x04) (RFC 1928 §5). socks5h is simply "send type 0x03".

  • In our 4 November 2026 test against a local RFC 1928/1929 server, curl 7.68, Python requests 2.34.2 (PySocks 1.7.1) and socks-proxy-agent 10.1.0 on Node 24 all connected with username and password on the first try, and each of the 4 error cases we triggered gave a specific message.

Why CleanProxies for SOCKS5

SOCKS5 only moves traffic. The IP behind it is what decides whether your accounts and scrapers run smoothly. CleanProxies ISP proxies are built for that:

  • Cleanest ISP IPs: 0 fraud score, super clean, on Tier-1 carrier ASNs in the United States (Comcast, AT&T, Cox, Frontier, RCN and more).

  • 100% dedicated IPs, never shared, static for the whole month.

  • Unlimited bandwidth and threads. SOCKS5 apps such as launchers and sync tools can be heavy, and you never pay per GB on ISP plans.

  • 100Gbps network ports, under 20 ms latency, 99.9% uptime, instant delivery and great 24/7 support.

  • SOCKS5, HTTP(S) or IP whitelist on the same plan, switched from the dashboard.

  • The cheapest pricing in the market: ISP proxies as low as $0.75/IP, ISP Subnet (/24 blocks) from $1.19/IP.

Pre-launch checklist

  1. Plan switched to SOCKS5 in the dashboard and the list copied again afterwards.

  2. One line tested in the proxy checker: it works and shows the IP in the carrier and country you bought.

  3. Inside the app itself, an IP check page (for example api.ipify.org or our what is my IP tool) shows that same IP.

  4. Your tool uses socks5h:// (or "proxy DNS" / "resolve through proxy" is on).

  5. In Python, both http and https keys are set, and requests[socks] is installed.

  6. One IP per account or job, mapped the same way on every run.

  7. Browsers and headless automation go through Proxifier or an antidetect browser, or use a second plan in HTTP mode.

  8. Not a customer yet? Try the whole setup with the $4.99 trial (5 ISP IPs for 1 hour): start the trial.

Pricing

ProductSOCKS5Price (as low as)Billing
ISP proxies (static residential)Yes (dashboard switch)$0.75/IPMonthly, unlimited bandwidth
ISP Subnet (/24)Yes (dashboard switch)$1.19/IPMonthly, unlimited bandwidth
Rotating residentialHTTP(S) gateway$0.63/GBData never expires
Mobile 4G/5GHTTP(S) gateway$0.79/GBData never expires

See every tier on the pricing page.

Get started

Set up SOCKS5 once and every tool on this page runs on clean, dedicated US IPs. Get SOCKS5 ISP proxies as low as $0.75/IP, compare all plans on /pricing, or test your list for free with the proxy checker.

Frequently Asked Questions

Get the proxy IP, port, username and password, then point your tool at socks5h://USER:PASS@IP:PORT. With CleanProxies ISP proxies, switch the plan to SOCKS5 in Proxy Manager and copy the list again; the username and password stay the same.

With socks5:// your machine resolves the hostname and sends the proxy an IP address. With socks5h:// the proxy receives the hostname and resolves it. In our 4 Nov 2026 test, curl and Python requests behaved exactly this way. Use socks5h for almost everything.

Yes. ISP and ISP Subnet plans support SOCKS5 with username and password through the auth type switch in the dashboard, next to HTTP(S) with user:pass and IP whitelisting. Rotating residential and mobile proxies use an HTTP(S) gateway with username and password.

requests needs the PySocks package for SOCKS proxies. Run pip install "requests[socks]" and use socks5h://USER:PASS@HOST:PORT for both the http and https keys.

Not through Chrome's own proxy settings or the --proxy-server flag, which have no SOCKS5 username and password support. Use Proxifier, an antidetect browser such as AdsPower, or keep the plan in HTTP (User Pass) mode for browser work.

No. SOCKS5 passes traffic without encrypting it, and the username and password login (RFC 1929) is sent in clear text. Your data is encrypted only when the connection inside the proxy uses HTTPS or another encrypted protocol.

Team CleanProxies
Proxy Infrastructure Team
Tags
  • socks5
  • socks5 proxy
  • isp proxies
  • proxy setup
  • curl
  • python

Related Articles