Selenium proxy configuration across languages
BytesFlows uses standard HTTP proxy settings compatible with all WebDriver implementations.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
PROXY_HOST = 'p1.bytesflows.com'
PROXY_PORT = 8001
PROXY_USER = 'YOUR_USER'
PROXY_PASS = 'YOUR_PASS'
options = Options()
options.add_argument(f'--proxy-server=http://{PROXY_HOST}:{PROXY_PORT}')
# Note: Chrome doesn't support proxy auth via args directly
# Use a proxy extension or the manual approach below for auth
driver = webdriver.Chrome(options=options)
# For authenticated proxy, use CDP command:
driver.execute_cdp_cmd('Network.setExtraHTTPHeaders', {
'headers': {
'Proxy-Authorization': 'Basic ' + __import__('base64')
.b64encode(f'{PROXY_USER}:{PROXY_PASS}'.encode())
.decode()
}
})
driver.get('https://httpbin.org/ip')
print(driver.find_element('tag name', 'body').text)
driver.quit()Chrome does not support proxy authentication via command-line args. Use CDP Network.setExtraHTTPHeaders to inject the Proxy-Authorization header, or use a proxy extension (see seleniumwire approach).
How Selenium routes requests through BytesFlows
Selenium delegates all network requests to the underlying browser engine, which respects proxy configuration set via ChromeOptions or FirefoxOptions.
WebDriver script
Python/Java/Node.js script launches the browser with proxy options via ChromeOptions or FirefoxOptions.
Browser engine
Chrome or Firefox reads the --proxy-server flag and routes all page requests through the configured proxy.
BytesFlows gateway
Gateway authenticates the request using sub-user credentials and selects a residential node matching the geo parameters.
Residential exit
All page requests exit through a real home broadband IP. The target site sees organic residential traffic.
Selenium 4+ supports CDP (Chrome DevTools Protocol) directly β use it for proxy authentication injection without external libraries.