Move scripts written for IPRoyal, PIA S5 or 922S5-style services over to
Proxy302 by converting the proxy string. It reads the common formats
host:port:user:pass and user:pass@host:port (and scheme:// URLs) and prints
the equivalent Proxy302 gateway string. Standard library only, Python 3.8+.
No network access, no telemetry.
git clone https://github.com/proxy302/proxy302-migrator.git
cd proxy302-migrator
python3 p302_migrator.py --demoNo packages to install: one Python file, standard library only.
python3 p302_migrator.py --demo # offline demo, fake data
python3 -m unittest # run the tests
# 1. Create a proxy in your Proxy302 account (dashboard, `proxy302 proxy us`,
# or the open API). Creating one is free; traffic is billed per GB. Note its username and password.
# 2. Convert your old list:
export PROXY302_USER='your-proxy-username'
export PROXY302_PASS='your-proxy-password'
python3 p302_migrator.py old_proxies.txt --country us --sticky --minutes 10
echo 'geo.example:12321:u:pw_country-de_session-abc12345_lifetime-10m' | python3 p302_migrator.pyOptions: --country cc, --sticky, --minutes 1-120, --protocol http|socks5,
--line budget|premium|datacenter, --format url|colon|at|env, --host
(or PROXY302_HOST). Notes go to stderr, converted lines to stdout.
# before: proxies = {"https": "http://user:pass@old-host:port"}
proxies = {"https": "http://YOUR_USER-country-us:YOUR_PASS@proxy.proxy302.com:2222"}| Item | Value |
|---|---|
| Host | proxy.proxy302.com |
| HTTP / SOCKS5 port | 2222 / 3333 |
| Username | <your proxy username>-country-<cc>[-session-<id>[-sessTime-<minutes>]] |
| Rotating | country only: a new IP on every new connection |
| Sticky | session-<id> keeps one IP; sessTime 1-120 minutes, budget line only |
| State / city / ISP | chosen when the proxy is created through the open API (premium line), not a username tail |
The username and password are those of a proxy in your own Proxy302 account; the old service's credentials are never reused or sent anywhere.
- IPRoyal (official docs: docs.iproyal.com, residential proxy location and
rotation pages):
HOST:PORT:USERNAME:PASSWORD, with options appended to the password:_country-xx,_city-name,_state-name,_session-<8 chars>,_lifetime-10m. Country, session and lifetime are mapped; city/state print a note (see TODO). A list of several countries is rejected. - PIA S5 and 922S5: only the generic
host:port:user:pass/user:pass@host:portlayouts are parsed. Their own option syntax is not read (see below).
--local-gateway points the output at 127.0.0.1:30200 (SOCKS5 + HTTP on one
port). It is for the Proxy302 client's local gateway and is not available
until the client is released. Leave it off for now.
- PIA S5: no official API or proxy-list format document could be found; only third-party descriptions (export as IP, port, user, password). Nothing specific to PIA is implemented. Send a sample export and we will add it.
- 922S5Proxy: no official extraction/list format document could be found. Same as above.
- IPRoyal:
_lifetimeunits other thanm(s/h/d) are accepted by this tool but only10mappears in the pages we read. Their API (account/order endpoints) is not translated. - City/state targeting: needs
state_id/city_idwhen the proxy is created via the Proxy302 open API. A helper that creates the proxy for you is TODO. - Translating "fetch me N proxies" API calls from the other services into Proxy302 open API calls (and reshaping the response) is TODO; v0 converts strings only.
- Whether the local gateway accepts the same username tails: TODO until release.
- Not tested against live gateways (no network, no keys were used).
Compatible with the common formats of IPRoyal, PIA S5 and 922S5-style lists. Product names belong to their owners; this project is not affiliated with them.
MIT License.
On 2026-12-03 the generated username tails were dialled through proxy.proxy302.com (US):
HTTP port 2222 rotating (-country-us), HTTP sticky (-session-<id>-sessTime-10, two requests held the same exit IP),
and SOCKS5 port 3333 sticky. All exits were in the US.