Code examples

Working proxy examples in cURL, Python and Node.js. The examples below use Budget Unlimited (residential.proxyomega.com:10000), but the same pattern works for every product. Swap the host and port and you're done.

i
One pattern, every product. Every ProxyOmega product speaks HTTP, HTTPS and SOCKS5 on the same host and port. To adapt any example below, change only the host, the port, and the targeting parameters where they are supported. See the per-product host and port table under Swapping products.

Before you start

These examples assume username + password authentication. Your username and password are shown in your dashboard. If you prefer credential-free access, add your server's public IP under Whitelist and drop the user:pass@ part of the URL. See Authentication for both methods.

Throughout, replace USER and PASS with your own credentials. Targeting parameters are appended to the username (dash-separated); the password never changes. For the full parameter list see Targeting, and for how sticky sessions work see Sessions & rotation.

i
SOCKS5. Every example here uses the HTTP proxy scheme. To use SOCKS5 instead, swap http:// for socks5://, for example socks5://USER:[email protected]:10000. Budget Unlimited supports HTTP, HTTPS and SOCKS5.

cURL

The -x flag sets the proxy. We hit https://api.ipify.org so the response is just the exit IP the request came out on.

Fresh IP per request (unique session ids)

On Budget Unlimited each port rotates on your configured interval (1 minute to 24 hours), so two plain requests on the same port return the same IP until the interval elapses. To get a different IP per request, give each request its own -session-<id> — every distinct session id gets its own IP, and you can run many session ids on one port at once:

# Two different session ids - two different IPs
curl -x "http://USER-session-a1:[email protected]:10000" https://api.ipify.org
curl -x "http://USER-session-a2:[email protected]:10000" https://api.ipify.org

Sticky + country

Add -country-us to target the United States, -session-abc123 to hold one IP, and -ttl-30 to keep that IP for 30 minutes:

# US exit, same IP held for 30 minutes
curl -x "http://USER-country-us-session-abc123-ttl-30:[email protected]:10000" https://api.ipify.org
i
SOCKS5 with cURL. Use the socks5:// scheme: curl -x "socks5://USER:[email protected]:10000" https://api.ipify.org.

Python (requests)

The requests library takes a proxies dict. Set the same proxy URL for both the http and https keys so all traffic is routed:

Fresh IP per request (unique session ids)

import requests

# A unique -session id per request = a different IP per request.
# (Without a session, the port keeps one IP until your rotation interval elapses.)
for i in range(2):
    user = f"USER-session-req{i}"
    proxy = f"http://{user}:[email protected]:10000"
    proxies = {"http": proxy, "https": proxy}
    r = requests.get("https://api.ipify.org", proxies=proxies, timeout=30)
    print(r.text)

Sticky + country

Put the targeting parameters in the username. Here we pin a US IP for 30 minutes:

import requests

user = "USER-country-us-session-abc123-ttl-30"
proxy = f"http://{user}:[email protected]:10000"
proxies = {"http": proxy, "https": proxy}

r = requests.get("https://api.ipify.org", proxies=proxies, timeout=30)
print(r.text)  # same IP for the life of the session
i
SOCKS5 in Python. Install the extra with pip install "requests[socks]", then use the socks5:// scheme in the proxy URL, for example socks5://USER:[email protected]:10000.

Node.js

Two common approaches: axios with https-proxy-agent, or the built-in fetch with an agent.

axios + https-proxy-agent (fresh IP per request)

Install the agent with npm install axios https-proxy-agent. Passing the agent as both httpProxy and httpsProxy ensures every request is routed:

import axios from "axios";
import { HttpsProxyAgent } from "https-proxy-agent";

// A unique -session id per request = a different IP per request
for (let i = 0; i < 2; i++) {
  const proxy = `http://USER-session-req${i}:[email protected]:10000`;
  const agent = new HttpsProxyAgent(proxy);
  const res = await axios.get("https://api.ipify.org", {
    httpAgent: agent,
    httpsAgent: agent,
    proxy: false, // let the agent handle it
  });
  console.log(res.data);
}

fetch + agent (sticky + country)

Node's built-in fetch accepts a dispatcher/agent. Put the targeting parameters in the username to pin a US IP for 30 minutes:

import { HttpsProxyAgent } from "https-proxy-agent";

const user = "USER-country-us-session-abc123-ttl-30";
const proxy = `http://${user}:[email protected]:10000`;
const agent = new HttpsProxyAgent(proxy);

const res = await fetch("https://api.ipify.org", { agent });
console.log(await res.text()); // same IP for the whole session
i
SOCKS5 in Node.js. Swap https-proxy-agent for socks-proxy-agent (npm install socks-proxy-agent) and build the agent from a socks5://USER:[email protected]:10000 URL.

Rotating vs sticky in code

The only thing that controls rotation is the -session value in your username:

  • No session. Omit -session and the port keeps one IP, rotating automatically on your configured interval (Budget Unlimited: 1 minute to 24 hours). Back-to-back requests return the same IP until the interval elapses.
  • Fresh IP per request. Send a different -session value on every request. Each distinct session id gets its own IP, and many session ids can run on one port at the same time.
  • Sticky. Keep the same -session value across requests. All those requests share one IP. Add -ttl-<minutes> to control how long that IP is held (Budget Unlimited: up to 24 hours).

The same three usernames, side by side, show it clearly:

# No session: one IP per port, auto-rotating on your configured interval
USER-country-us

# Sticky "session A": every request with this string shares one IP
USER-country-us-session-A-ttl-30

# Sticky "session B": a different string = a different held IP
USER-country-us-session-B-ttl-30

To force a rotation on a sticky session, change the session string (for example bump a counter: -session-batch1, -session-batch2, and so on). In code that usually means interpolating a variable:

# A fresh sticky IP per worker, each held for 10 minutes
for worker_id in range(5):
    user = f"USER-country-us-session-worker{worker_id}-ttl-10"
    proxy = f"http://{user}:[email protected]:10000"
    proxies = {"http": proxy, "https": proxy}
    r = requests.get("https://api.ipify.org", proxies=proxies, timeout=30)
    print(worker_id, r.text)

Swapping products

To adapt any example above to a different product, change the host and port, plus the targeting parameters where they are supported. Everything else stays identical: the username/password format and the code structure don't change.

i
Protocols are the same everywhere. Every product supports HTTP, HTTPS and SOCKS5 on the same host and port, so the http:// proxy scheme in these examples works for all of them (swap to socks5:// for SOCKS5). UDP is supported only on IPv6.
ProductHostPortProtocolsTargeting in username
Budget Unlimitedresidential.proxyomega.com10000-10099HTTP, HTTPS, SOCKS5Configured per port in dashboard
Premium Unlimitedassigned in dashboard8000HTTP, HTTPS, SOCKS5country, state, city, asn, session, ttl
Residential / ISPplatinum.proxyomega.com20228HTTP, HTTPS, SOCKS5country, region, city, asn, session, ttl
Mobilemobile.proxyomega.com20229HTTP, HTTPS, SOCKS5country
IPv6ipv6.proxyomega.com9000HTTP, HTTPS, SOCKS5country, session
Static ISPisp.proxyomega.com30000-30099HTTP, HTTPS, SOCKS5none; each port is a fixed IP

For example, the same rotating cURL call against Residential/ISP with ASN and city targeting:

# Residential / ISP - Los Angeles, AS7018, sticky 15 min
curl -x "http://USER-country-us-region-california-city-los_angeles-asn-7018-session-la1-ttl-15:[email protected]:20228" https://api.ipify.org

Static ISP needs no rotation parameters at all. Each port from 30000 to 30099 is already one of your dedicated pinned IPs:

# Static ISP - connect straight to a pinned IP, no targeting params
curl -x "http://USER:[email protected]:30000" https://api.ipify.org

Next steps

Targeting

The full list of country, state, city and ASN parameters, and which products accept each. Read Targeting →

Sessions & rotation

How -session and -ttl control sticky IPs, and the maximum sticky duration per product. Read Sessions & rotation →

Authentication

Username/password versus IP whitelist, and how to connect with no credentials at all. Read Authentication →

Last updated July 10, 2026