Skip to content
LightningBytes
Back to Blog

How to Use Residential Proxies: A Setup Walkthrough

From picking a plan to your first proxied request: creating credentials, choosing a location, and testing the connection with curl, Python and a browser.

by LightningBytes Team
  • residential-proxies
  • tutorials

This is the practical path from nothing to a working request through a residential proxy, with the checkpoints that tell you each step succeeded.

Step 1: Decide what you need

Before buying, settle two things: which markets you need addresses in, and whether your work needs continuity or can rotate freely.

If your requests are independent reads, rotation is fine. If any flow involves a login, a cart or a multi-step form, plan for sticky sessions. The trade-off is in Rotating vs Sticky Proxies.

Also estimate volume, because residential plans are metered. The method is in What Is Proxy Bandwidth.

Step 2: Choose the service and plan

Pick the line that matches your targets. Residential handles most defended sites; if your target refuses residential addresses, look at mobile instead, which we compare in Residential vs Mobile Proxies.

The residential page lists packages, coverage and targeting options. Choose a small package first. You can scale once you have measured your real usage.

Step 3: Create a proxy user

Credentials are issued per sub-user, so each application or identity can have its own. That matters for two reasons: you can revoke one without affecting the others, and two identities sharing credentials share an IP, which links them.

In the dashboard, create a sub-user and note down:

  • The gateway host and port.
  • The username, including any targeting or session parameters.
  • The password.

The naming and targeting conventions are described in Proxy Authentication and Country, State, and City Targeting.

Treat the password as a secret immediately. Put it in an environment variable, not in source code.

Step 4: Build the connection string

For HTTP:

http://USERNAME:PASSWORD@proxy.lightningbytes.com:1080

For SOCKS5, use the dedicated SOCKS port and a socks5:// scheme. The protocol choice matters for tooling compatibility, which we cover in SOCKS5 vs HTTP Proxies.

Step 5: Test with curl

The fastest sanity check. This requests a service that echoes your IP:

curl -x "http://USERNAME:PASSWORD@proxy.lightningbytes.com:1080" \
  --max-time 20 https://api.ipify.org

The address printed is your exit IP. Confirm it is where you expected by looking it up, and note the latency with the -w timing option if you are benchmarking.

If this step fails, stop here and fix it. A 407 means the credentials or allowlisting are wrong. A timeout usually means the host or port is wrong. Those distinctions are laid out in Proxy Authentication.

Step 6: Test with Python

import os
import requests

proxy = os.environ["LB_PROXY_URL"]  # http://user:pass@host:port

with requests.Session() as session:
    session.proxies = {"http": proxy, "https": proxy}
    response = session.get("https://api.ipify.org", timeout=20)
    print(response.status_code, response.text)

Using a Session keeps the connection alive across requests, which matters when you are sending many. Pooling and rotation strategy are covered in What Is a Proxy Pool and Proxy Rotation Explained.

Step 7: Test in a browser

For manual inspection, configure the proxy in the browser or system settings. Remember that a browser loads images, scripts and fonts, so it consumes far more bandwidth than a script fetching JSON. If you are just verifying the exit IP, use the script instead.

For browser automation, the setup differs per tool; Playwright Scraping with Proxies and Selenium Proxy Setup and Rotation cover the common ones.

Step 8: Confirm and instrument

Two checks before you scale:

  • Exit IP and location. Use the proxy checker for IP and latency, and IP lookup for country and city. Confirm your targeting works.
  • Session behaviour. Send several requests with one session and confirm the IP holds, then change the session and confirm it changes.

Then add logging: record which session and exit IP served each request. That single field turns a mystery failure into an attributable one, and it is the foundation of the pool design in What Is a Proxy Pool.

Step 9: Respect the target

Set concurrency per endpoint to one, add backoff on rate-limit responses, and honour Retry-After when a server sends it. Careless retries are the most common way to convert a working setup into a blocked one, which we cover in Rate Limiting vs Blocking.

Where to go next

With a working connection, the natural next reads are Static vs Rotating Residential Proxies if you need continuity, and Residential Proxy Use Cases for workload-specific guidance. For a broader picture of the different proxy types, the FAQ answers the common setup questions.

Start working with cleaner IPs

Clean, pre-filtered residential and mobile proxies, sign up and send your first request in minutes.

We use cookies for authentication and security. With your consent we also enable optional marketing & analytics cookies. See our privacy policy.