# 代理测试工具

基于网页的测试工具，用于验证凭证、调试用户名、检查 helodata 返回的元信息。位置：**控制台 → 资源 → 代理测试**（公开版本：[helodata.com/tools/proxy-tester](https://helodata.com/tools/proxy-tester)）。

## 它做什么

粘凭证、点 **测试**，立即看到：

* 认证是否通过
* 出口 IP、国家、州、城市、ASN、ISP
* 延迟分解（connect / TLS / TTFB / total）
* 实际发送的完整 `Proxy-Authorization` 头
* 解析后的用户名各字段——对调 `bad-username` 错误特别有用
* 来自网关的原始响应头

\[screenshot: 代理测试结果面板]

## 何时用

* 部署前——确认子账号凭证与限额可用
* 调 `407`——精确查看实际发送的认证头
* 校验 geo——出口 IP 是否匹配 `region` / `state` / `city`
* 测延迟——为你这边访问网关建立基线
* 验证 ASN 定位——确认拿到的是想要的运营商

## 用户名解析

支持 **完整代理 URL** 或 **分字段**：

```
http://helo_s1a2b3c4d5e-type-res-region-us-state-ca-city-la:PASSWORD@gate.helodata.io:7777
```

解析显示：

```
prefix:    helo_
subuser:   s1a2b3c4d5e
type:      res         (residential)
region:    us
state:     ca
city:      la
session:   —           (none)
sesstime:  —
asn:       —
```

字段格式错时会在解析结果中以红色高亮并附提示。

## Geo 验证

测试展示：

* **helodata 标注的 geo**（即 `X-Helodata-Exit-Geo`）
* **MaxMind geo**（多数目标在用的第三方库）
* **IPinfo geo**（第二个第三方参考）

三者不一致请查 [IP 地理位置不匹配](/helodata-zh/gu-zhang-pai-cha/ip-location-mismatch.md)。

## 程序化测试

CI 冒烟测试用 API：

```bash
curl -X POST -H "Authorization: Bearer API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
       "username": "helo_s1a2b3c4d5e-type-res-region-us",
       "password": "PASSWORD"
     }' \
     https://api.helodata.com/v1/tools/proxy-test
```

响应：

```json
{
  "auth_ok":     true,
  "exit_ip":     "198.51.100.42",
  "exit_geo":    { "country": "us", "state": "ca", "city": "los angeles" },
  "exit_asn":    7922,
  "latency_ms":  { "connect": 24, "tls": 89, "ttfb": 178, "total": 312 },
  "parsed":      { "subuser": "s1a2b3c4d5e", "type": "res", "region": "us", "state": null, "city": null, "session_id": null, "sesstime": null, "asn": null }
}
```

## 隐私

工具**绝不**记录密码（即便我方支持人员在内部日志中也看不到）。完整请求保留 24 小时方便你跨轮次比较，之后删除。

## 常见陷阱

* **复制带了尾部空白** — 工具会捕获并提示，但许多其他客户端会静默失败，请 trim。
* **测了另一个账号的凭证** — 多账号时很常见。工具仅作用于发起它的 API Key 所属账号。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.helodata.com/helodata-zh/zi-yuan/proxy-tester.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
