# 协议

每个 ISP IP 在同一端口（`8000`）上支持 HTTP、HTTPS、SOCKS5，由客户端握手自动识别——无需逐 IP 配置。

## HTTP / HTTPS

```bash
# HTTP 目标
curl -x http://helo_s1a2b3c4d5e:PASSWORD@198.51.100.42:8000 http://example.com

# HTTPS 目标（端到端 TLS）
curl -x http://helo_s1a2b3c4d5e:PASSWORD@198.51.100.42:8000 https://example.com
```

HTTPS 目标时，客户端向代理发送 `CONNECT example.com:443` 打通 TCP 隧道，helodata 看不到请求体。

## SOCKS5

```bash
curl --socks5-hostname helo_s1a2b3c4d5e:PASSWORD@198.51.100.42:8000 \
     https://ipv4.icanhazip.com
```

使用 `--socks5-hostname`（curl）或 `socks5h://`（Python `requests` 等）让代理做 DNS——否则本地解析会泄露 DNS，地理服务也会出错。

### Python

```python
import requests
proxy = "socks5h://helo_s1a2b3c4d5e:PASSWORD@198.51.100.42:8000"
r = requests.get("https://ipv4.icanhazip.com",
                 proxies={"http": proxy, "https": proxy}, timeout=30)
```

### Node.js

```js
import { SocksProxyAgent } from "socks-proxy-agent";
import fetch from "node-fetch";
const agent = new SocksProxyAgent("socks5://helo_s1a2b3c4d5e:PASSWORD@198.51.100.42:8000");
const res = await fetch("https://ipv4.icanhazip.com", { agent });
```

## 如何选择

权衡同住宅，完整对照表见 [住宅协议](https://docs.helodata.com/helodata-zh/chan-pin/overview-2/pages/VZlkTLpU9NyClk5IN2Hx#如何选择)。

## ISP 特有提示

* **到目标的 HTTP/2** 通过 `CONNECT` 隧道工作，helodata 不降级。
* **长连接特别划算** — ISP IP 稳定，连接池（HTTP keep-alive、HTTP/2 多路复用）回报丰厚。**保持连接，不要逐请求重连**。
* **WebSocket 与 gRPC** 可用，把 IP 当作普通 HTTP 代理即可。

## 不支持

* SOCKS4 / SOCKS4a — 请用 SOCKS5
* 把定位参数塞到用户名里（`-type-`、`-region-` 等） — ISP 凭证就是纯 `user:pass`。任何额外的字段会原样发到服务端并被 `407 auth-failed` 拒绝。


---

# 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/chan-pin/overview-2/protocols.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.
