Proxies
When to solve through your own proxy, proxy fields and types, the 2Captcha proxy format and proxy errors.
本節內容以英文顯示。
Types with a proxy — RecaptchaV2Task, RecaptchaV2EnterpriseTask, RecaptchaV3EnterpriseTask — are solved through your proxy, so Google sees your IP address. Use them when the site binds the token to the IP that submits it, or when the v3 / Enterprise score depends on the IP. Otherwise proxyless types are simpler.
Fields#
參數說明
proxyTypestringhttp(default),https,socks4orsocks5.proxyAddressstring必填- IP address or host name of the proxy. Private and local addresses are rejected.
proxyPortinteger必填- Proxy port, 1–65535.
proxyLoginstring- Proxy login, up to 256 characters. Stored encrypted.
proxyPasswordstring- Proxy password, up to 256 characters. Stored encrypted.
{
"type": "RecaptchaV2Task",
"websiteURL": "https://www.google.com/recaptcha/api2/demo",
"websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
"proxyType": "http",
"proxyAddress": "proxy.example.com",
"proxyPort": 8080,
"proxyLogin": "user",
"proxyPassword": "pass"
}Proxy types#
| proxyType | Proxy |
|---|---|
http, https | HTTP proxy; HTTPS traffic goes through a CONNECT tunnel |
socks4 | SOCKS4 proxy (no login and password) |
socks5 | SOCKS5 proxy |
2Captcha format#
In in.php pass proxy=login:password@host:port (or host:port) and proxytype=HTTP, HTTPS, SOCKS4 or SOCKS5. A string that cannot be parsed answers ERROR_BAD_PROXY.
Requirements and tips#
- The proxy must be reachable from the internet. Prefer login and password authorization to IP allowlists on the proxy.
- Private, local and reserved addresses (
10.0.0.0/8,192.168.0.0/16,127.0.0.1,localhost…) are rejected withERROR_TASK_ABSENT. - Residential or mobile proxies near the users of the site work best; datacenter IPs are banned by Google more often.
- Submit the token through the same proxy and with the same
userAgent. - Proxy credentials and cookies are stored encrypted.
Proxy errors#
A task that failed because of the proxy is not charged.
| errorId | errorCode | When |
|---|---|---|
| 25 | ERROR_PROXY_CONNECT_REFUSED | the proxy refused the connection |
| 26 | ERROR_PROXY_CONNECT_TIMEOUT | connecting to the proxy timed out |
| 27 | ERROR_PROXY_READ_TIMEOUT | the proxy did not answer in time |
| 28 | ERROR_PROXY_BANNED | the proxy IP is blocked by Google or the site |
| 49 | ERROR_PROXY_NOT_AUTHORISED | wrong proxy login or password |
| 35 | ERROR_PROXY_HAS_NO_IMAGE_SUPPORT | the proxy does not load images |