Connection Issues Resolution
curl -x http://username:password@proxy-endpoint:port http://httpbin.org/ip
curl --connect-timeout 10 --max-time 30 -x http://proxy-endpoint:port http://httpbin.org/ip
curl -v -x http://username:password@proxy-endpoint:port http://httpbin.org/ip
- Verify proxy endpoint URL and port number are correct
- Test basic connectivity without authentication first
- Check if your firewall is blocking the proxy port
- Ensure your network allows outbound connections to proxy endpoints
- Test with a simple HTTP request before attempting HTTPS
- Validate that the proxy server is operational and responsive
Authentication Problems
import requests
proxies = {
'http': 'http://username:password@proxy-endpoint:port',
'https': 'http://username:password@proxy-endpoint:port'
}
try:
response = requests.get('http://httpbin.org/ip', proxies=proxies, timeout=10)
print(f"Success: {response.json()}")
except requests.exceptions.ProxyError as e:
print(f"Proxy Error: {e}")
except requests.exceptions.Timeout as e:
print(f"Timeout Error: {e}")
- Double-check username and password for typos or special characters
- Verify your IP address is whitelisted in the proxy dashboard
- Test authentication with URL encoding for special characters
- Ensure credentials haven't expired or been rotated
- Try authentication with both HTTP and HTTPS endpoints
- Contact support if credentials appear correct but authentication fails
Performance Optimization
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
session = requests.Session()
retry_strategy = Retry(
total=3,
backoff_factor=1,
status_forcelist=[429, 500, 502, 503, 504]
)
adapter = HTTPAdapter(max_retries=retry_strategy, pool_connections=20, pool_maxsize=20)
session.mount("http://", adapter)
session.mount("https://", adapter)
session.proxies = {
'http': 'http://username:password@endpoint:port',
'https': 'http://username:password@endpoint:port'
}
session.timeout = (10, 30)