Skip to content

Proxy Format: user:pass@host:port vs host:port:user:pass

The same proxy can be written four ways. Pick the one your tool asks for, and convert the rest without retyping the password.

Four ways to write one proxy

Four ways to write one proxy
ItemExampleTypical place to type it
Fields in separate boxesHost, Port, Login, PasswordBrowser, Telegram, system and app proxy forms
HOST:PORT:LOGIN:PASSWORDHOST:2222:LOGIN:PASSWORDBulk-import boxes with one proxy per line
LOGIN:PASSWORD@HOST:PORTLOGIN:PASSWORD@HOST:2222Tools that take one proxy string without a protocol
URL formhttp://LOGIN:PASSWORD@HOST:2222curl, Python Requests, environment variables

Layouts as described in the curl manual and the Requests documentation (read 15 November 2026) and in the Proxy302 bulk-import and Dolphin {anty} format guides. The last column is typical, not a rule: the hint under the input box of your own tool decides.

Why the order matters

A URL has the shape scheme://userinfo@host:port, so the login and password come first and are separated from the host by @. A list layout has no such marker, so the tool counts colons: first field host, second port, third login, fourth password.

That counting is what breaks when the password itself holds a colon or an @. In the URL form those characters must be percent-encoded, as the curl manual says: @ becomes %40 and a colon becomes %3a. In a bulk-import box there is usually no encoding; the safest fix is a password without those characters, or a tool that documents how it splits.

The scheme also matters. curl treats a proxy with no scheme or with http:// as an HTTP proxy, and socks5:// or socks5h:// as SOCKS5, so the port must match: 2222 for HTTP and 3333 for SOCKS5 on Proxy302.

Convert any line in Python

from urllib.parse import quote
import re

def parse(line):
    line = line.strip()
    if "://" in line:
        line = line.split("://", 1)[1]
    if re.match(r"^[^:@/]+:\d+:", line):   # HOST:PORT:LOGIN:PASSWORD
        host, port, user, password = line.split(":", 3)
    elif "@" in line:                    # LOGIN:PASSWORD@HOST:PORT
        auth, _, hostport = line.rpartition("@")
        user, _, password = auth.partition(":")
        host, _, port = hostport.rpartition(":")
    else:
        raise ValueError("unknown format: " + line)
    return host, port, user, password

def to_at(h, p, u, pw):
    return f"{u}:{pw}@{h}:{p}"

def to_colon(h, p, u, pw):
    return f"{h}:{p}:{u}:{pw}"

def to_url(h, p, u, pw, scheme="http"):
    return f"{scheme}://{quote(u, safe='')}:{quote(pw, safe='')}@{h}:{p}"


for line in open("proxies.txt"):
    if line.strip():
        print(to_url(*parse(line), scheme="http"))

Example only. It reads proxies.txt with one proxy per line in either list or @ layout (an optional scheme is ignored) and prints http:// URLs with the login percent-encoded. Replace http with socks5h to print SOCKS5 URLs.

Swap the two list layouts with awk

# HOST:PORT:LOGIN:PASSWORD  ->  LOGIN:PASSWORD@HOST:PORT
awk -F: '{printf "%s:%s@%s:%s\n", $3, $4, $1, $2}' proxies.txt

# LOGIN:PASSWORD@HOST:PORT  ->  HOST:PORT:LOGIN:PASSWORD
awk -F'[:@]' '{printf "%s:%s:%s:%s\n", $3, $4, $1, $2}' proxies.txt

Example only. It assumes the login and the password contain no colon or @. If they might, use the Python version above.

Convert and import a list safely

  1. Step 1: Copy the fields from My assets

    Open My assets and copy host, port, login and password for one IP. Copy them instead of typing, so special characters survive.

  2. Step 2: Check the port and the protocol

    Port 2222 is HTTP and port 3333 is SOCKS5 on the Proxy302 gateway. Each IP is issued with one protocol, so the scheme in your string must match it.

  3. Step 3: Convert one line and test it

    Build the string your tool wants, then run the curl check below. Each line should print the exit IP.

    Expected result The exit IP and country, not an error or a 407.

  4. Step 4: Convert the rest and import

    Run the converter on the whole list, paste it into the tool and add one proxy first. Add the others only when the first one connects.

Test one converted line with curl

curl -x http://LOGIN:PASSWORD@HOST:2222 https://ipinfo.io/json
curl -x socks5h://LOGIN:PASSWORD@HOST:3333 https://ipinfo.io/json

Example only: replace the placeholders with the values from My assets. Use the line that matches the protocol of that IP. If the password has special characters, percent-encode them.

When a converted line is rejected

The tool says the format is invalid or reads the port as part of the host

Check Is the order host, port, login, password, or login, password, host, port, exactly as the tool's hint shows?

Fix Swap to the layout in the hint. Remove spaces and a trailing newline from the line.

407 or a login prompt that keeps coming back

Check Does the password contain @, a colon or %?

Fix Percent-encode it in URL strings, or paste the login into separate fields. See the 407 guide.

Stop when If a copy-pasted login still fails in curl, stop editing strings and contact Support with the order number.

Connection reset or timeout on port 3333 with an IP bought as HTTP

Check Which protocol was the IP issued with?

Fix Use port 2222 with http://, or buy an IP with SOCKS5 for port 3333.

Proxy format FAQ

What is the correct proxy format?

There is no single one. The same five fields can be written as HOST:PORT:LOGIN:PASSWORD, LOGIN:PASSWORD@HOST:PORT or http://LOGIN:PASSWORD@HOST:PORT. Use the one the tool's input hint shows.

How do I convert host:port:user:pass to user:pass@host:port?

Split the line at the first three colons into host, port, login and password, then join them as login:password@host:port. The awk and Python examples on this page do it.

What if my password contains @ or a colon?

In a URL string write @ as %40 and a colon as %3a; curl decodes them. In a plain list the safest course is a password without those characters.

Does curl need the http:// prefix?

No. With no scheme curl treats the proxy as HTTP, but write the scheme anyway so a reader can see whether it is http, socks5 or socks5h.

Is it safe to keep a proxy list with passwords in a text file?

Treat the file as a secret: keep it out of shared folders and version control, as the Requests documentation warns about credentials in files.

Proxy302 values

On Proxy302 the host, port, login and password of every IP are listed in My assets. HTTP uses port 2222 and SOCKS5 uses port 3333, and each IP is issued with one protocol, chosen when you buy.

A static residential IP costs US$0.50 for 1 day and US$7.99 for 30 days (7.99 ÷ 30 ≈ US$0.27 a day), the same in every country. There is no free trial; the smallest purchase is one IP for one day.

Reference links

5
  1. RFC 3986: URI Generic Syntax

    Official documentation · Confirmed on:

    Read on 15 November 2026: the authority is [ userinfo "@" ] host [ ":" port ]; userinfo allows percent-encoded characters; the user:password form in userinfo is marked deprecated and a password in it should be treated with care.

  2. curl manual page

    Official documentation · Confirmed on:

    Read on 15 November 2026: -x/--proxy takes [protocol://]host[:port]; no protocol or http:// means an HTTP proxy, socks5:// and socks5h:// request SOCKS5; user and password in the proxy string are URL decoded, so @ is written %40 and a colon %3a.

  3. Requests docs: Proxies

    Official documentation · Confirmed on:

    Read on 15 November 2026: for HTTP Basic Auth with a proxy use the http://user:password@host/ syntax in the proxies dictionary or in the HTTP_PROXY / HTTPS_PROXY variables; the docs warn that keeping credentials in environment variables or version-controlled files is a security risk.

  4. Python docs: urllib.parse

    Official documentation · Confirmed on:

    Read on 15 November 2026: quote(string, safe) percent-encodes a string; the example quote('/El Niño/') gives '/El%20Ni%C3%B1o/'.

  5. Proxy302 product facts and price list

    Product observation · Confirmed on:

    Product facts file of the site (values checked against the console, the backend and the price table in October 2026, protocol tests of 4 November 2026): products, prices in US$ (1 PTC = US$1), lease terms, protocols and ports, countries, no free trial.

Ready to try it?

Create an account, top up once, then pick rotating residential, static ISP or datacenter IPs and have one running in your browser within minutes.