Set up a proxy user
- Log in to the client area, open My Services and click your server. Scroll to Use your IP from code, n8n, CI or a browser. Under Add a proxy user, type
pythonand click Add.
You should see: a new card namedapp-python. Names can use letters and digits only, and MazeVPN adds theapp-prefix. - On that card, click Copy next to HTTPS proxy (marked Encrypted). The copied URL contains the password, so paste it only into a secret or environment variable, never into code.
The card of a new proxy user. The eye icon shows the password; Copy copies the full URL with the password. (Server IP replaced with an example.) You should see: a URL likehttps://app-python:…@203.0.113.42:443, where the address is your server’s IP. - Install both clients and the optional Requests SOCKS dependency. Set MAZE_PROXY_URL in your secret store to a URL in the example format.
python -m pip install "requests[socks]" httpxYou should see: Both clients import successfully. The HTTPS proxy URL has the form https://app-python:PASSWORD@203.0.113.42:443.
Requests: compare explicit, session, and environment settings
In a November 24, 2026 test in WSL, the direct Requests call returned the machine’s IPv4. The explicit, session, and environment settings, both HTTPX clients, and Requests over SOCKS5 all returned the QA server’s IPv4.
Keep the destination URL HTTPS. The scheme of the proxy URL describes the connection to the proxy itself. Set both dictionary keys when both HTTP and HTTPS destinations should use the same proxy.
Per Requests docs, environment settings can override Session.proxies. Set trust_env=False on a session when you want to isolate it from machine-wide settings. This also turns off other environment-derived settings, so configure any custom certificate bundle explicitly.
import os
import requests
url = "https://api.ipify.org"
p = os.environ["MAZE_PROXY_URL"]
proxies = {"http": p, "https": p}
def show(label, response):
response.raise_for_status()
print(label, response.text.strip())
with requests.Session() as s:
s.trust_env = False
show("direct", s.get(url, timeout=(5, 15)))
show("explicit", s.get(url, proxies=proxies, timeout=(5, 15)))
s.proxies.update(proxies)
show("session", s.get(url, timeout=(5, 15)))
os.environ["HTTPS_PROXY"] = p
show("environment", requests.get(url, timeout=(5, 15)))HTTPX: sync and async
Reuse a Client or AsyncClient for multiple requests. A timeout limits time spent waiting on the network. HTTPX supports separate connect, read, write, and pool timeouts when you need finer control.
import asyncio
import os
import httpx
url = "https://api.ipify.org"
p = os.environ["MAZE_PROXY_URL"]
timeout = httpx.Timeout(15.0, connect=5.0)
with httpx.Client(proxy=p, trust_env=False, timeout=timeout) as client:
r = client.get(url)
r.raise_for_status()
print("sync", r.text.strip())
async def main():
async with httpx.AsyncClient(proxy=p, trust_env=False, timeout=timeout) as client:
r = await client.get(url)
r.raise_for_status()
print("async", r.text.strip())
asyncio.run(main())Requests: SOCKS5 with proxy-side DNS
For a tool that requires SOCKS5, set MAZE_SOCKS_URL to socks5h://app-python:PASSWORD@203.0.113.42:1080. The socks5h scheme asks the proxy to resolve the hostname. SOCKS5 does not add TLS to the client-to-proxy link. Prefer the HTTPS proxy for HTTP clients that support it.
import os
import requests
p = os.environ["MAZE_SOCKS_URL"]
with requests.Session() as s:
s.trust_env = False
r = s.get("https://api.ipify.org", proxies={"http": p, "https": p}, timeout=(5, 15))
r.raise_for_status()
print(r.text.strip()) Official references
Skip the setup
A dedicated IPv4 in 38 cities, usually ready about 3 minutes after payment. Connect devices with WireGuard and apps with an authenticated HTTPS, HTTP, or SOCKS5 proxy. From $9.99/month.