Connect ThorData to CloakBrowser and troubleshoot your first proxy request
You have a ThorData residential proxy and a Python browser task to run. The first milestone is small: open ThorData’s IP check page through CloakBrowser and see the address that the page receives. If that fails, a second request with the same proxy settings can help you decide what to inspect next.
Quick answer: Generate a ThorData Dynamic Residential connection with username/password authentication and Rotating Session. Pass its HTTP address, complete proxy username and password to CloakBrowser. Run the browser check below; if it fails, switch the same script to its HTTP-client mode. The two results help distinguish a shared connection problem from a difference between the clients.
The ThorData setup and rotation descriptions follow its documentation and the setup recommended by its team. The code has been checked with a local authenticated proxy; this is not a live test of ThorData’s residential network.
Build one ThorData connection
You need an active ThorData Dynamic Residential plan with usable traffic. If you need an account, get started with ThorData. You also need Python, CloakBrowser license access and a working browser installation. Follow the CloakBrowser Quick Start for the basic launch, then install the packages used here:
python -m pip install cloakbrowser requests
requests is the small HTTP client used for the optional control check. CloakBrowser runs the browser; ThorData supplies its proxy connection. The first browser launch may download the browser binary.
In ThorData, follow the User & Pass auth instructions. Under Proxies → Residential Proxies → Proxy Setup → Users, create a proxy user with Add or Quick Add. Confirm that it is enabled and has usable traffic within its configured limit.
Open Proxy Setup → Endpoint Generator, choose username/password authentication (labelled User in the documentation), and select that proxy user. For this walkthrough, choose Rotating Session and HTTP as the proxy protocol. Select a country only if your task needs one. Generate the connection and keep all its fields together.
ThorData distinguishes the proxy username from the login used to manage your dashboard. Use the generated proxy credentials, including any parameters in the username. Do not shorten the username to your account email or add sticky-session parameters to this rotating example.
For a fictional connection, the four values could look like this:
| Value from the generator | How this guide uses it |
|---|---|
Host: proxy.example | Hostname only; the script adds http:// |
HTTP port: 9999 | Use the port from your generated HTTP connection |
Username: td-customer-demo-country-us | Keep the complete generated value |
Password: EXAMPLE_PASSWORD | Use the proxy user’s password |
These are illustrations, not working credentials. Use the host and port ThorData actually generates for you. The proxy connection in this example uses HTTP; the destination page uses HTTPS. Those are separate settings.
Open the IP check page in CloakBrowser
Save the following as check_thordata.py. Run it in an interactive terminal so the password can be entered without appearing on screen. It accepts two modes: browser for CloakBrowser and http for the diagnostic control.
import argparse
import json
import warnings
from getpass import GetPassWarning, getpass
from ipaddress import ip_address
from urllib.parse import quote
parser = argparse.ArgumentParser()
parser.add_argument("client", choices=["browser", "http"])
mode = parser.parse_args().client
url = "https://ipinfo.thordata.com"
warnings.simplefilter("error", GetPassWarning)
try:
host = input("ThorData HTTP proxy host: ").strip()
port = int(input("HTTP proxy port: ").strip())
if not host or any(c.isspace() or c in "/:@?#" for c in host):
raise ValueError("Enter only a hostname or IPv4 address.")
if not 1 <= port <= 65535:
raise ValueError("Invalid port.")
username = input("Complete proxy username: ").strip()
password = getpass("Proxy password: ")
if not username or not password:
raise ValueError("Both proxy credentials are required.")
server = f"http://{host}:{port}"
if mode == "browser":
from cloakbrowser import launch
browser = launch(proxy={
"server": server,
"username": username,
"password": password,
})
try:
page = browser.new_page()
response = page.goto(url, timeout=30000)
status = response.status if response else None
print(f"browser: HTTP {status}")
if status != 200:
raise ValueError("IP check did not return HTTP 200.")
data = json.loads(page.locator("body").inner_text())
finally:
browser.close()
else:
import requests
auth = f"{quote(username, safe='')}:{quote(password, safe='')}"
proxy_url = f"http://{auth}@{host}:{port}"
with requests.Session() as session:
session.trust_env = False
response = session.get(
url, proxies={"https": proxy_url},
timeout=30, allow_redirects=False,
)
print(f"http: HTTP {response.status_code}")
if response.status_code != 200:
raise ValueError("IP check did not return HTTP 200.")
data = response.json()
observed = ip_address(str(data["ip"]))
print(f"{mode}: public IP seen by ThorData: {observed}")
print(f"{mode}: reported country: {data.get('country', 'unknown')}")
except Exception as exc:
print(f"{mode}: check failed ({type(exc).__name__}).")
raise SystemExit(1) from None
Start with the browser mode:
python check_thordata.py browser
Paste the four values from your generated connection when prompted. The script opens ThorData’s IP check page with page.goto, reads its JSON response from the browser page and prints the returned IP and country. The browser closes after the check.
A successful run reports HTTP 200 and a valid IP seen by the check page. Other statuses, invalid JSON and missing/invalid IPs fail validation. Errors show a category without exposing proxy URLs or passwords.
Compare with the same page in a regular browser on this machine without the ThorData configuration, keeping any VPN unchanged. Different IPs establish different exits; matching IPs need investigation. This does not test every browser network channel.
If it fails, run a control with the same settings
Before changing the proxy user, country or mode, run:
python check_thordata.py http
Enter exactly the same four values. This mode sends a request from Python’s Requests library to the same ThorData page. It uses an explicit proxy and ignores proxy settings inherited from environment variables. HTTPS certificate verification remains enabled. Password characters such as @ are encoded when building the HTTP client’s proxy URL; the browser receives the username and password as separate fields.
This is a separate HTTP-client observation, not a browser test. Run both checks close together on the same machine and network, changing one setting at a time.
| What you observe | Where to look next |
|---|---|
| Neither client returns a valid IP | Recheck the generated credentials, enabled user, available traffic, HTTP host/port and network access. The proxy service or check page may also be unavailable; two failures do not identify the cause. |
| HTTP client works; browser fails | Confirm that the browser actually starts with valid CloakBrowser access. Then recheck the copied proxy fields and HTTP protocol. Client-specific network restrictions, certificates or destination responses can also differ. |
| Browser works; HTTP client fails | Inspect the HTTP-client error and its certificate/network environment. This does not invalidate a successful browser observation. |
| Both work; the IPs differ | ThorData documents per-request rotation in this mode. Different exit IPs alone are not a configuration error. Equal IPs alone do not prove a sticky session either. |
Separate setup errors from network errors. If the script fails before printing an HTTP status, check whether it reached navigation at all. A blank or nonnumeric port, a URL pasted into the host field, or an unavailable hidden-password prompt can stop it before any proxy request. In browser mode, an installation or license problem can also prevent the browser from launching.
If a status is printed but validation fails, the response is not the expected IP document. A destination’s 403 does not prove the proxy password is wrong. Check the page and provider status before changing credentials.
When you correct a field or reset a proxy password, repeat both commands with the corrected values. Keep the useful report small: client, time, HTTP status if available and error category. Never include the proxy password or a complete authenticated proxy URL in a shared log.
Questions that come up during the first connection
Can I use my ThorData dashboard login in CloakBrowser?
Use the proxy user selected in Endpoint Generator. ThorData explicitly separates that credential from the dashboard management login. Regenerating the connection is a better starting point than guessing which account fields to reuse.
Does HTTP proxy mean the destination must use HTTP?
No. This example connects to an HTTP proxy and requests an HTTPS destination through it. Use the HTTP connection generated for this walkthrough; do not change its scheme to https:// merely because the destination URL starts with HTTPS.
Why do the terminal and browser show different IPs?
They make separate requests through a rotating service. Compare whether each receives a valid response with the intended configuration. This two-client check neither measures the rotation rate nor guarantees a different IP on every browser navigation.
Can I use this example for a login flow that needs one IP?
The example checks an initial rotating connection. A workflow that depends on a stable exit needs a separately chosen session policy and checks across the actual sequence. Keep that requirement explicit before extending this script into a logged-in flow.
Does the reported country prove how my own site will classify me?
It is the country reported by this check service. Your site may use a different geolocation database. With rotation, a later request can also use another exit; inspect your site’s own request logs when validating its regional behavior.
Take the working connection into your browser task
Once the browser check works, use the same configuration for a small test on your own site and inspect the request that reaches it. A successful IP check establishes a starting point; your real task still needs its own checks and error handling. For that next step, read Browser automation in production.
Ready to connect ThorData to CloakBrowser? Get started with ThorData, generate your residential connection and run the browser check above. Use the CloakBrowser Quick Start if you still need your first browser launch.
Disclosure: This article may contain referral links. CloakBrowser may earn a commission if you make a purchase through them.