Skip to content

Commit 987feea

Browse files
authored
Update README.md (haoel#107)
1 parent 1c91800 commit 987feea

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
- [9.4 Cloudflare Warp 原生 IP](#94-cloudflare-warp-原生-ip)
5252
- [9.4.1 WARP 模式](#941-warp-模式)
5353
- [9.4.2 代理模式](#942-代理模式)
54+
- [9.4.3 Docker 代理](#943-docker-代理)
5455
- [10. 其它](#10-其它)
5556
- [10.1 其它方式](#101-其它方式)
5657
- [10.2 搭建脚本](#102-搭建脚本)
@@ -1162,6 +1163,38 @@ LimitNOFILE=65535
11621163
LimitNOFILESoft=65535
11631164
```
11641165

1166+
#### 9.4.3 Docker 代理
1167+
1168+
用 Docker 可以更方便地部署起一个 Cloudflare WARP Proxy,只需要一行命令:
1169+
1170+
```shell
1171+
docker run -v $HOME/.warp:/var/lib/cloudflare-warp:rw --restart=always --name=cloudflare-warp e7h4n/cloudflare-warp
1172+
```
1173+
1174+
这条命令会在容器上的 40001 开启一个 socks5 代理,接下来查看这个容器的 ip:
1175+
1176+
```shell
1177+
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' cloudflare-warp
1178+
```
1179+
1180+
然后可以通过 curl 镜像来测试,例如,如果容器的 ip 是 `172.17.0.2`,则可以运行:
1181+
1182+
```shell
1183+
docker run --rm curlimages/curl --connect-timeout 2 -x "socks5://172.17.0.2:40001" ipinfo.io
1184+
```
1185+
1186+
返回的结果中 `org` 字段应该能看到 Cloudflare 相关的信息。
1187+
1188+
接下来我们给 Gost 增加一个条件转发规则,转发我们希望的域名、地址到 cloudflare 的 warp 网络:
1189+
1190+
```
1191+
-F=socks5://172.17.0.2:40001?notls=true&bypass=~*.openai.com,openai.com
1192+
```
1193+
1194+
`bypass=~` 的含义是,只有命中后面规则时才转发请求到 `172.17.0.2:40001` 这个 socks5 代理。
1195+
1196+
接下来,通过这个 Gost 代理访问 openai.com 时,就会走 warp 网络了。
1197+
11651198
## 10. 其它
11661199

11671200
### 10.1 其它方式

0 commit comments

Comments
 (0)