Skip to content
On this page
Home
>API接口
>如何使用代理

如何使用代理

在一些captcha(令牌)获取的任务场景中,令牌验证通常会验证solve的令牌生成的IP地址,这个时候我们允许用户通过proxy 参数来设置自己的客户端ip地址。

WARNING

通常任务的type字段携带 ProxyLess 后缀即为不需要代理参数,不带后缀且不是图片识别的任务类型需要代理参数,具体请阅读任务类型文档

代理支持

我们支持以下代理类型:SOCKS4, SOCKS5, HTTP, HTTPS, IP地址或登录密码认证。 如果需要使用IP地址认证代理,请将下面两个ip地址加入白名单: 47.253.53.46 ,47.253.81.245

代理请求通用参数

我们支持2种代理传入的方式

  • 使用 proxyType proxyAddress 等分散参数方式,参考如下
  • 直接使用 proxy 参数拼接
json
{
    "clientKey": "YOUR_API_KEY",
    "task": {
        "websiteURL": "https://www.google.com/recaptcha/api2/demo",
        "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
        "type": "ReCaptchaV2Task",//通常携带ProxyLess后缀的任务类型不需要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
    }
}

proxy参数的format支持如下:

txt
# 支持socks5协议+鉴权
socks5:192.191.100.10:4780:user:pwd
# 支持http协议+鉴权
http:192.191.100.10:4780:user:pwd
# 默认使用http协议
192.191.100.10:4780:user:pwd
# 使用url dns的方式
http://user:pwd@ip:port
# 使用url socks5的方式
socks5://user:pwd@ip:port