> For the complete documentation index, see [llms.txt](https://docs.ipwo.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ipwo.net/dai-li-jian-ce-yu-yin-si-an-quan/ru-he-jian-ce-zhen-shi-ip-shi-fou-xie-lou.md).

# 如何检测真实IP是否泄露

在使用代理、指纹浏览器或多账号环境时，即使：

```
代理已经配置成功
```

仍然可能发生一个关键问题：

👉 真实 IP 泄露

这会导致平台直接识别你的真实网络环境。

***

## 🌍 一、什么是真实 IP 泄露？

真实 IP 泄露是指：

```
你以为在用代理
但部分请求仍然走本机网络
```

***

### ❌ 正常情况

```
浏览器 / 程序 → 代理 → 目标网站
```

***

### ⚠️ 泄露情况

```
部分流量 → 代理
部分流量 → 本机IP（泄露）
```

***

## ⚠️ 二、真实 IP 泄露的风险

如果发生泄露：

| 风险    | 说明       |
| ----- | -------- |
| 账号关联  | 多账号被识别   |
| 地区不一致 | 平台风控触发   |
| 代理失效  | 误以为代理未生效 |
| 数据污染  | 采集结果不可信  |

***

## 🧪 三、如何检测真实 IP 是否泄露？

***

### ✔ 方法1：curl 对比测试（推荐）

#### 1️⃣ 获取代理 IP

```bash
curl -x "http://username:password@us.ipwo.net:7878" https://api.ipify.org
```

记录返回 IP（代理IP）

***

#### 2️⃣ 不使用代理测试

```bash
curl https://api.ipify.org
```

记录返回 IP（本机IP）

***

### ✔ 判断标准：

| 测试    | 结果     |
| ----- | ------ |
| 使用代理  | 返回代理IP |
| 不使用代理 | 返回本机IP |
| 两者不同  | ✔ 正常   |

***

### ❌ 如果代理模式下仍出现本机IP：

👉 表示真实 IP 泄露

***

## 🌐 四、浏览器检测真实 IP（推荐）

访问：

```
https://ipinfo.io
```

或：

```
https://whatismyipaddress.com
```

***

### ✔ 检查内容：

* IP 地址
* 国家地区
* ISP 信息

***

### ✔ 正常情况：

```
显示代理 IP（如美国 / 日本）
```

***

### ❌ 异常情况：

```
显示中国 IP 或本机运营商
```

👉 表示泄露

***

## 🧪 五、Python 检测真实 IP

```python
import requests

# 使用代理
proxies = {
    "http": "http://username:password@us.ipwo.net:7878",
    "https": "http://username:password@us.ipwo.net:7878"
}

proxy_ip = requests.get(
    "https://api.ipify.org",
    proxies=proxies,
    timeout=10
).text

# 不使用代理
real_ip = requests.get("https://api.ipify.org", timeout=10).text

print("代理IP:", proxy_ip)
print("真实IP:", real_ip)
```

***

### ✔ 判断逻辑：

```
proxy_ip != real_ip → 正常
proxy_ip == real_ip → 未走代理
```

***

## 🌐 六、真实 IP 泄露的常见原因

***

### ❌ 1. 程序未正确配置代理

例如：

* requests 未设置 proxies
* curl 未加 -x 参数

***

### ❌ 2. 浏览器未全局代理

* 仅部分标签页走代理
* 插件未生效

***

### ❌ 3. WebRTC 泄露

浏览器仍暴露本机 IP

***

### ❌ 4. DNS 泄露

请求解析仍走本地网络

***

### ❌ 5. 应用绕过代理

部分软件：

```
默认直连网络
```

***

## ⚙️ 七、如何防止真实 IP 泄露？

***

### ✔ 方法1：全局代理模式

确保：

```
所有流量都经过代理
```

***

### ✔ 方法2：使用 [SOCKS5](/dai-li-ji-chu-zhi-shi/http-yu-socks5-qu-bie.md#shen-me-shi-socks5-dai-li)

SOCKS5 可减少部分绕过问题。

***

### ✔ 方法3：指纹浏览器隔离

例如：

* [AdsPower](/ji-cheng-jiao-cheng/zhi-wen-liu-lan-qi/adspower-liu-lan-qi-ji-cheng-zhi-nan.md)
* [MoreLogin](/ji-cheng-jiao-cheng/zhi-wen-liu-lan-qi/morelogin-liu-lan-qi-ji-cheng-zhi-nan.md)
* [Dolphin](/ji-cheng-jiao-cheng/zhi-wen-liu-lan-qi/dolphinanty-liu-lan-qi-ji-cheng-zhi-nan.md)

👉 强制所有流量走代理环境

***

### ✔ 方法4：关闭 [WebRTC](/dai-li-jian-ce-yu-yin-si-an-quan/webrtc-xie-lou-jian-ce.md)

避免浏览器直接暴露本机 IP。

***

### ✔ 方法5：[DNS](/dai-li-jian-ce-yu-yin-si-an-quan/dns-xie-lou-jian-ce.md) 使用海外解析

避免使用：

```
国内运营商 DNS
```

***

## 🧭 八、推荐检测流程（非常重要）

建议按顺序排查：

```
1. curl 代理测试
↓
2. curl 非代理测试
↓
3. IP 对比
↓
4. 浏览器 IP 检测
↓
5. WebRTC 检测
↓
6. DNS 检测
```

***

## 🚀 九、快速判断口诀

```
IP变了 ≠ 安全
全部流量走代理 = 真安全
```

***

## 📚 相关文章 / 相关阅读

* [如何检测代理是否生效](/dai-li-jian-ce-yu-yin-si-an-quan/ru-he-jian-ce-dai-li-shi-fou-sheng-xiao.md)
* [如何检测 IP 地区](/dai-li-jian-ce-yu-yin-si-an-quan/ru-he-jian-ce-ip-di-qu.md)
* [WebRTC 泄露检测](/dai-li-jian-ce-yu-yin-si-an-quan/webrtc-xie-lou-jian-ce.md)
* [DNS 泄露检测](/dai-li-jian-ce-yu-yin-si-an-quan/dns-xie-lou-jian-ce.md)
* [浏览器指纹检测](/dai-li-jian-ce-yu-yin-si-an-quan/liu-lan-qi-zhi-wen-jian-ce.md)
* [什么是公网 IP](/dai-li-ji-chu-zhi-shi/shen-me-shi-gong-wang-ip.md)
* [什么是粘性会话](/dai-li-ji-chu-zhi-shi/shen-me-shi-nian-xing-hui-hua.md)
* [什么是轮换 IP](/dai-li-ji-chu-zhi-shi/shen-me-shi-lun-huan-ip.md)
* [如何降低封禁风险](/dai-li-ji-chu-zhi-shi/ru-he-jiang-di-feng-jin-feng-xian.md)
* [代理连接失败](/gu-zhang-pai-chu/dai-li-lian-jie-shi-bai.md)

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.ipwo.net/dai-li-jian-ce-yu-yin-si-an-quan/ru-he-jian-ce-zhen-shi-ip-shi-fou-xie-lou.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
