代理检测,可检测已添加的用户代理,也可检测自定义代理。
POST /api/v1/proxy/check
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
| proxy_id | string | 否 | 代理ID,可通过代理列表获取 |
| host | string | 否 | host,当未传入 proxy_id 时必传 |
| port | int | 否 | 端口,当未传入 proxy_id 时必传 |
| user | string | 否 | 账号 |
| password | string | 否 | 密码 |
| ip_scan_channel | string | 否 | 代理检测渠道,支持:ip2location,ipapi,未传时默认为 ip2location |
{
"ip_scan_channel": "ip2location",
"host": "1xx.xx.xx.xxx",
"port": "xxxx",
"user": "Oxxxxx6",
"password": "3xxxxxx1"
}
{
"proxy_id": "aDvBj"
}
{
"code": 200,
"data": {
"success": true, // 检测结果,true 成功;false 失败
"ip": "6x.xxx.xx.xxx",
"country": "us", // 国家
"region": "new york", // 地区
"city": "buffalo", // 城市
"timezone": "America/New_York",
"longitude": "-78.882486", // 经度
"latitude": "42.878243", // 纬度
"tips": "",
"user": "xxxxx",
"password": "xxxxx"
},
"message": "Success"
}
{
"code": 200,
"data": {
"success": false,
"ip": "",
"country": "",
"region": "",
"city": "",
"timezone": "",
"longitude": "",
"latitude": "",
"tips": "连接测试失败!请确认代理信息正确且 IP 可用", // 检测失败信息
"user": "xxxxx",
"password": "xxxxx"
},
"message": "Success"
}