如何使用代理
在某些验证码(token)获取任务场景中,token 认证通常会验证生成 token 的 IP 地址,此时我们允许用户通过 proxy
参数设置其客户端 IP 地址。
WARNING
通常,任务的 type 字段带有 ProxyLess
后缀,即不需要代理参数;没有此后缀,但又不是图像识别的任务类型,则需要代理参数,详情请阅读任务类型文档
支持的代理类型
我们支持以下代理类型:SOCKS4, SOCKS5, HTTP, HTTPS, IP 地址或登录密码认证。
如果您需要使用 IP 地址认证代理,请将以下 IP 地址添加到白名单:47.253.53.46
, 47.253.81.245
, 47.253.148.135
, 47.252.73.71
, 47.253.123.100
, 47.253.144.89
, 47.89.153.185
, 47.253.44.80
, 47.253.210.178
代理请求参数
我们支持两种代理类型
- 使用
proxyType
、proxyAddress
等参数模式,参考如下 - 直接使用
proxy
参数进行拼接
{
"clientKey": "YOUR_API_KEY",
"task": {
"websiteURL": "https://www.google.com/recaptcha/api2/demo",
"websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
"type": "ReCaptchaV2Task",//Typically, task types that carry the ProxyLess do not require proxy
//You can send the proxy information with one of these proxy format, please read carefully
// proxy format 1
"proxyType": "https",// socks5 | http | https
"proxyAddress": "198.199.100.10",
"proxyPort": 3949,
"proxyLogin": "user",
"proxyPassword": "pass",
// proxy format 2
"proxy": "socks5:192.191.100.10:4780:user:pwd",
//or
"proxy": "198.199.100.10:4780:user:pwd", //You don't need to put the user:pwd if it's whitelisted IP proxy
}
}
代理参数的格式支持如下:
# Supports the socks5 protocol + authentication
socks5:192.191.100.10:4780:user:pwd
# Supports http + authentication
http:192.191.100.10:4780:user:pwd
# http is used by default
192.191.100.10:4780:user:pwd
# Use url dns
http://user:pwd@ip:port
# Use the url socks5
socks5://user:pwd@ip:port