# requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x...>: Failed to establish a new connection: [Errno 111] Connection refused'))

- **ID:** `python/requests-connectionerror-connection-refused`
- **Domain:** python
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

No service is listening on the specified host and port.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **Start the server or ensure it is running on the correct port** (95% success)
   ```
   Check if the server is running: netstat -tulpn | grep 8080
# Start the server if needed
   ```
2. **Use a different port that the server is actually listening on** (80% success)
   ```
   requests.get('http://localhost:3000')  # if server runs on port 3000
   ```

## Dead Ends

- **Increasing the timeout value** — The connection is refused immediately, so timeout does not matter. (95% fail)
- **Using a different protocol (e.g., HTTPS instead of HTTP)** — The port is not open for any protocol. (90% fail)
