# aiohttp.client_exceptions.ClientProxyConnectionError: Cannot connect to proxy

- **ID:** `python/aiohttp-client-connector-proxy-error`
- **Domain:** python
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The HTTP/HTTPS proxy server is unreachable or refusing connections.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.10 | active | — | — |
| 3.11 | active | — | — |

## Workarounds

1. **Verify proxy settings and use proxy authentication if needed** (85% success)
   ```
   proxy_auth = aiohttp.BasicAuth('user', 'pass')
async with aiohttp.ClientSession() as session:
    async with session.get(url, proxy='http://proxy.example.com:8080', proxy_auth=proxy_auth) as resp:
   ```
2. **Use environment variables for proxy configuration** (80% success)
   ```
   import os
os.environ['HTTP_PROXY'] = 'http://proxy.example.com:8080'
os.environ['HTTPS_PROXY'] = 'http://proxy.example.com:8080'
   ```

## Dead Ends

- **Disabling proxy usage entirely** — This may bypass corporate network policies or cause direct access failures. (40% fail)
- **Using a different proxy without authentication** — The new proxy may also be unreachable or require authentication. (50% fail)
