Before you start
You need a working proxy and its credentials from the Access panel. If you do not have one yet, the guide on turning an Android phone into a mobile proxy takes you through it. The examples use placeholders: replace USERNAME and PASSWORD with your own values. With a username and password the HTTP endpoint is api.falconproxy.com:8080 and the SOCKS5 endpoint is api.falconproxy.com:1080. With an allowed IP address, use the dedicated endpoints the panel shows.
- Playwright
- Puppeteer
- Selenium
- curl
- Python
One proxy
Your phone, through FalconProxy
Endpoints
api.falconproxy.com:8080api.falconproxy.com:1080HTTP and SOCKS5
| Tool | Endpoint | Sign-in |
|---|---|---|
| curl | HTTP or SOCKS5 | Username and password, or an allowed IP address. |
| Python requests | HTTP or SOCKS5 | Username and password in the proxy URL. |
| Playwright | HTTP | Username and password in their own fields. |
| Puppeteer | HTTP | A call to page.authenticate. |
| Selenium with Chrome | HTTP | An allowed IP address: Chrome ignores credentials in the proxy flag. |
curl
HTTP
curl -x http://USERNAME:PASSWORD@api.falconproxy.com:8080 https://api.ipify.orgSOCKS5
curl --proxy socks5h://USERNAME:PASSWORD@api.falconproxy.com:1080 https://api.ipify.orgA password with special characters is easier to pass with --proxy-user, because both the shell and a URL treat some characters specially. Put the password in single quotes:
curl -x http://api.falconproxy.com:8080 --proxy-user 'USERNAME:PASSWORD' https://api.ipify.orgTo use the proxy for every curl command in a shell session, set an environment variable. curl reads https_proxy, http_proxy and all_proxy.
export https_proxy="http://USERNAME:PASSWORD@api.falconproxy.com:8080"
curl https://api.ipify.orgPython requests
import requests
proxy = "http://USERNAME:PASSWORD@api.falconproxy.com:8080"
proxies = {"http": proxy, "https": proxy}
response = requests.get("https://api.ipify.org", proxies=proxies, timeout=30)
print(response.text)Always pass a timeout. Without one, a request through a phone that has dropped off can wait for a very long time. To reuse connections across many requests, set the proxies on a session:
session = requests.Session()
session.proxies.update(proxies)
print(session.get("https://api.ipify.org", timeout=30).text)For SOCKS5, install the extra that adds support and use socks5h, so the name lookup also goes through the proxy:
pip install "requests[socks]"proxy = "socks5h://USERNAME:PASSWORD@api.falconproxy.com:1080"Playwright
Put the credentials in the username and password fields. Playwright drops credentials written inside the server URL, and the proxy then answers 407. The same proxy option also takes a bypass list of hosts that should not use the proxy, such as localhost.
Python
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(
proxy={
"server": "http://api.falconproxy.com:8080",
"username": "USERNAME",
"password": "PASSWORD",
}
)
page = browser.new_page()
page.goto("https://api.ipify.org")
print(page.inner_text("body"))
browser.close()Node.js
import { chromium } from 'playwright'
const browser = await chromium.launch({
proxy: {
server: 'http://api.falconproxy.com:8080',
username: 'USERNAME',
password: 'PASSWORD',
},
})
const page = await browser.newPage()
await page.goto('https://api.ipify.org')
console.log(await page.innerText('body'))
await browser.close()Puppeteer
Puppeteer takes the proxy as a browser flag and the credentials in a separate call on the page. Call page.authenticate before the first page.goto, and call it again on every new page, because the credentials belong to the page and not to the browser.
import puppeteer from 'puppeteer'
const browser = await puppeteer.launch({
args: ['--proxy-server=http://api.falconproxy.com:8080'],
})
const page = await browser.newPage()
await page.authenticate({ username: 'USERNAME', password: 'PASSWORD' })
await page.goto('https://api.ipify.org')
console.log(await page.evaluate(() => document.body.innerText))
await browser.close()Selenium
Chrome ignores a username and password written in its --proxy-server flag, so with Selenium the dependable route is to sign in by IP address. In the proxy’s Access panel, choose IP whitelist and Manage whitelist, and add the public address of the machine that runs the browser. The panel then shows a dedicated HTTP endpoint for your proxy. Use it as HOST and PORT below; no credentials are needed.
from selenium import webdriver
from selenium.webdriver.common.by import By
options = webdriver.ChromeOptions()
options.add_argument("--proxy-server=http://HOST:PORT")
driver = webdriver.Chrome(options=options)
driver.get("https://api.ipify.org")
print(driver.find_element(By.TAG_NAME, "body").text)
driver.quit()If you need a username and password with Selenium, drive the browser with Playwright instead, which handles the sign-in itself.
Check that it works
Each example above prints the address a website sees. Run one without the proxy and compare: the two addresses should differ, and the one through the proxy should be your phone’s. For the carrier, the location and the name lookup, see the guide on checking a proxy’s exit IP, carrier and DNS.
| What you see | Usual cause | What to do |
|---|---|---|
net::ERR_PROXY_CONNECTION_FAILED | The browser cannot reach the proxy. | Check the host and the port, your network, and that the proxy’s status is Live. |
net::ERR_TUNNEL_CONNECTION_FAILED | The proxy refused the tunnel, often because the credentials did not arrive. | Put the credentials in their own fields, or add your IP address to the allow list. |
407 Proxy Authentication Required | The username or password is wrong, or was not sent. | Copy them again from the Access panel. |
- Keep the credentials in environment variables or a secrets manager rather than in the script.
- Close the browser when the job ends, so connections through the phone do not stay open.