支持协议:http/https/socks5(tcp/udp)
- 固定代理地址:
x.x.x.x
- 固定代理HTTP/socks5 端口: 44001-45000 (开通数量范围内,如开通100个就是44001-44100)
1. 基础请求
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"orderId": "test",
"time": 1627800000,
"sign": "生成的签名",
"ports": [44301,44300],
"ip": "1.1.1.1",
"pid":-1,
"cid":-1,
"type": 1,
"auth": "test:test123"
}' \
http://macaddr.vpsnb.net/api/change
地区筛选模式
参数组合 | 行为 | 示例 |
---|---|---|
pid=-1 , cid=-1 |
全国随机分配 | {“pid”:”-1”,”cid”:”-1”} |
pid=13 , cid=-1 |
山东省内随机城市 | {“pid”:”13”,”cid”:”-1”} |
pid=13 , cid=118 |
精确到济南市节点 | {“pid”:”13”,”cid”:”118”} |
认证机制
1. 签名生成规则
python
import hashlib
import time
def generate_sign(order_id: str, timestamp: int, secret_key: str) -> str:
sign_str = f"{order_id}{timestamp}{secret_key}"
return hashlib.md5(sign_str.encode()).hexdigest()
# 示例
timestamp = int(time.time())
signature = generate_sign("test", timestamp, "your_secret_key")
2. 请求参数要求
参数名 | 类型 | 必填 | 说明 |
---|---|---|---|
orderId | String | 是 | 订单ID(需提前申请) |
time | Number | 是 | 10位UNIX时间戳(秒级) |
sign | String | 是 | 按规则生成的MD5签名 |
ports | Array | 是 | 需要切换的端口 (开通后获取) |
ip | String | 是 | 绑定的网关IP (开通后获取) |
pid | String | 否 | 省份编码(默认-1全国随机)见附件 |
cid | String | 否 | 城市编码(默认-1全省随机)见附件 |
type | Number | 否 | 代理模式(1:http/https 2:socks5)默认1 |
auth | String | 否 | 代理账密,格式: “test:test123” ,可联系客服预设,预设后不用每次传。否则必须每次传。 |
响应格式
成功响应
json
{
"code": 0,
"data": [
{
"ip": "1.1.1.1",
"port": 44001,
"macaddr": "DCD87C4A2553",
"realIp": "183.225.42.208",
"province": "云南",
"city": "曲靖"
},
{
"ip": "1.1.1.1",
"port": 44300,
"macaddr": "DCD87C4CC2E8",
"realIp": "183.225.42.217",
"province": "云南",
"city": "曲靖"
}
]
}
错误响应
json
{
"code": 403,
"message": "签名验证失败(错误原因)"
}
错误代码说明
状态码 | 含义 | 常见原因 |
---|---|---|
400 | 请求参数错误 | 缺少必填参数/参数格式错误 |
403 | 认证失败 | 签名错误/时间戳过期 |
500 | 服务器内部错误 | 联系客服处理 |
作者:admin 创建时间:2024-05-27 12:09
最后编辑:admin 更新时间:2025-04-01 16:42
最后编辑:admin 更新时间:2025-04-01 16:42