ERROR_PROXY_NOT_AUTHORIZED means CaptchaAI cannot connect through your specified proxy. This guide covers all causes and fixes.
Common Causes
| Cause | How to Check |
|---|---|
| Wrong proxy format | Verify type:host:port:user:pass format |
| Proxy requires IP whitelisting | Check if proxy provider whitelists IPs |
| Proxy credentials expired | Test proxy connection directly |
| Wrong proxy type specified | Verify HTTP vs SOCKS4 vs SOCKS5 |
| Proxy server down | Test connectivity to proxy |
| Special characters in password | URL-encode the password |
Correct Proxy Format
CaptchaAI expects the proxy in this format:
proxytype: HTTP | HTTPS | SOCKS4 | SOCKS5
proxy: host:port:username:password
import requests
# Correct format
data = {
"key": "YOUR_API_KEY",
"method": "userrecaptcha",
"googlekey": "SITE_KEY",
"pageurl": "https://example.com",
"proxytype": "HTTP",
"proxy": "192.168.1.1:8080:myuser:mypass",
"json": 1,
}
resp = requests.post("https://ocr.captchaai.com/in.php", data=data)
Proxy Format Variations
# With authentication
proxy = "192.168.1.1:8080:username:password"
# Without authentication (rare — most captcha proxies need auth)
proxy = "192.168.1.1:8080"
# SOCKS5
proxytype = "SOCKS5"
proxy = "192.168.1.1:1080:user:pass"
Validation Before Submission
import re
import requests
def validate_proxy(proxy_str, proxy_type="HTTP"):
"""Validate proxy format and connectivity."""
# Check format
parts = proxy_str.split(":")
if len(parts) < 2:
raise ValueError(f"Invalid proxy format: {proxy_str}")
host = parts[0]
port = parts[1]
if not port.isdigit():
raise ValueError(f"Invalid port: {port}")
# Check proxy type
valid_types = {"HTTP", "HTTPS", "SOCKS4", "SOCKS5"}
if proxy_type not in valid_types:
raise ValueError(f"Invalid proxy type: {proxy_type}")
return True
def test_proxy(proxy_str, proxy_type="HTTP"):
"""Test if proxy is working."""
parts = proxy_str.split(":")
host = parts[0]
port = parts[1]
if len(parts) == 4:
user, password = parts[2], parts[3]
proxy_url = f"{proxy_type.lower()}://{user}:{password}@{host}:{port}"
else:
proxy_url = f"{proxy_type.lower()}://{host}:{port}"
proxies = {"http": proxy_url, "https": proxy_url}
try:
resp = requests.get(
"https://httpbin.org/ip",
proxies=proxies,
timeout=10,
)
print(f"Proxy working. IP: {resp.json()['origin']}")
return True
except Exception as e:
print(f"Proxy failed: {e}")
return False
# Test before using with CaptchaAI
proxy = "192.168.1.1:8080:user:pass"
if test_proxy(proxy, "HTTP"):
print("Proxy is ready to use")
Handling Special Characters in Passwords
from urllib.parse import quote
def format_proxy(host, port, username, password):
"""Format proxy string, handling special characters."""
# URL-encode password if it contains special characters
safe_password = quote(password, safe="")
return f"{host}:{port}:{username}:{safe_password}"
# Password with special characters
proxy = format_proxy("192.168.1.1", "8080", "user", "p@ss:word!")
Proxy Type Detection
def detect_proxy_type(host, port):
"""Try to detect which proxy protocol works."""
import socket
for proxy_type in ["HTTP", "SOCKS5", "SOCKS4"]:
try:
# Basic TCP connection test
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(5)
result = sock.connect_ex((host, int(port)))
sock.close()
if result == 0:
return proxy_type # Port is open, try this type
except Exception:
continue
return None
Troubleshooting
| Issue | Cause | Fix |
|---|---|---|
| Error with correct credentials | Proxy requires IP whitelisting | Whitelist CaptchaAI IPs or use auth-only proxies |
| Works locally, fails via CaptchaAI | CaptchaAI server IP not whitelisted | Use username/password auth instead |
| SOCKS proxy fails | Wrong type specified | Try SOCKS5 or SOCKS4 |
| Intermittent auth failures | Proxy rate limiting | Use dedicated/premium proxies |
Password with : breaks format |
Unescaped special characters | URL-encode the password |
FAQ
Does CaptchaAI connect through my proxy?
Yes. When you provide proxy parameters, CaptchaAI's solver loads the target page through your proxy. This ensures the token matches your browsing context.
Which proxy type should I use?
Use HTTP/HTTPS for most sites. Use SOCKS5 when the target requires it or for better anonymity. SOCKS4 is rarely needed.
Do I always need a proxy?
No. Proxies are optional. Many CAPTCHAs solve fine without a proxy. Use proxies when the target site checks if the solver's IP matches the token submission IP.
Related Guides
Fix proxy issues — solve with CaptchaAI.
Discussions (0)
Join the conversation
Sign in to share your opinion.
Sign InNo comments yet.