# 如何检查代理是否可用

如果代理未连接，或者您想确保一切正常，可以使用两种简单的方法进行检查。

***

## 方法1：网站上的代理测试器

最快的选择。

打开我们的[代理测试器](https://proxyshard.com/proxy-tester)，将代理粘贴到字段中，然后单击“**测试代理**”。

请阅读[代理测试器](/cn/chan-pin/proxy-tester.md) 文章，了解有关功能和格式的更多信息。

***

## 方法2：通过curl（命令行）检查

当您需要直接从计算机快速检查连接时，此方法适用。它适用于 Windows、macOS 和 Linux。

### Windows

打开命令提示符：按 <mark style="color:blue;">WIN+R</mark>，输入 `cmd`，然后按 Enter。

### macOS / Linux

打开终端（在 macOS 上，通过 Spotlight 或应用程序 > 实用程序文件夹）。

***

### 检查 HTTP 代理

```bash
curl -x http://USERNAME:PASSWORD@PROXY_IP:PORT -I https://www.google.com
```

真实数据示例：

```bash
curl -x http://KWFFEKf:LDLFEPF@88.99.123.233:44454 -I https://www.google.com
```

### 检查 SOCKS5 代理

```bash
curl --socks5 USERNAME:PASSWORD@PROXY_IP:PORT -I https://www.google.com
```

例子：

```bash
curl --socks5 KWFFEKf:LDLFEPF@88.99.123.233:44454 -I https://www.google.com
```

***

### 如何解释结果

{% hint style="success" %}
**代理有效。** 如果响应包含 `HTTP/1.1 200 OK` 或 `HTTP/2 200`，则连接成功。
{% endhint %}

{% hint style="danger" %}
**代理不起作用。** 如果您收到 `Connection refused`、`Connection timed out` 或 `Could not resolve proxy` 等错误，则表明连接失败。
{% endhint %}

### 如果无法连接怎么办

1. 重新检查用户名、密码、IP 和端口。一个常见的错误是混淆了 **HTTP** 和 **SOCKS5** 端口
2. 尝试通过 VPN 连接，以排除 ISP 的阻止 3.购买后等待2-3分钟：服务器需要时间更新
3. 如果没有帮助，请联系[支持](/cn/contact-us.md)


---

# 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.proxyshard.com/cn/wen-da/faq/general-questions/how-to-check-proxy.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.
