File tree 1 file changed +33
-0
lines changed 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 51
51
- [ 9.4 Cloudflare Warp 原生 IP] ( #94-cloudflare-warp-原生-ip )
52
52
- [ 9.4.1 WARP 模式] ( #941-warp-模式 )
53
53
- [ 9.4.2 代理模式] ( #942-代理模式 )
54
+ - [ 9.4.3 Docker 代理] ( #943-docker-代理 )
54
55
- [ 10. 其它] ( #10-其它 )
55
56
- [ 10.1 其它方式] ( #101-其它方式 )
56
57
- [ 10.2 搭建脚本] ( #102-搭建脚本 )
@@ -1162,6 +1163,38 @@ LimitNOFILE=65535
1162
1163
LimitNOFILESoft =65535
1163
1164
```
1164
1165
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
+
1165
1198
## 10. 其它
1166
1199
1167
1200
### 10.1 其它方式
You can’t perform that action at this time.
0 commit comments