Use ProxyHQ with AIOHTTP
Use ProxyHQ with the AIOHTTP library for fast async requests.
Connection details
Use these values. Your login and password are in your dashboard.
| Type | HTTP (or SOCKS5) |
| Host | gw.proxyhq.net |
| Port (HTTP / HTTPS) | 823 |
| Port (SOCKS5) | 824 |
| Sticky ports | 10000 - 20000 |
| Username | YOUR_LOGIN |
| Password | YOUR_PASSWORD |
Steps
- Install AIOHTTP with pip install aiohttp.
- Pass the proxy address with the proxy argument and the login with proxy_auth.
- Run the script with asyncio.run.
import asyncio
import aiohttp
async def main():
auth = aiohttp.BasicAuth("YOUR_LOGIN__cr.us", "YOUR_PASSWORD")
async with aiohttp.ClientSession() as session:
async with session.get("https://api.ipify.org",
proxy="http://gw.proxyhq.net:823",
proxy_auth=auth,
timeout=aiohttp.ClientTimeout(total=30)) as r:
print(await r.text())
asyncio.run(main())Choose a country or a sticky IP
Add __cr.de (or another country code) to the end of your login to choose a country. Use a port from 10000 to 20000 for a sticky IP. See country targeting and rotating vs sticky.
Stuck? See troubleshooting or email [email protected].