1、docker安装cf wap
github地址:https://github.com/cmj2002/warp-docker.git
代码
version: "3"
services:
warp:
image: caomingjun/warp
container_name: warp
restart: always
# add removed rule back (https://github.com/opencontainers/runc/pull/3468)
device_cgroup_rules:
- 'c 10:200 rwm'
ports:
- "1080:1080"
environment:
- WARP_SLEEP=2
# - WARP_LICENSE_KEY= # optional
# - WARP_ENABLE_NAT=1 # enable nat
cap_add:
# Docker already have them, these are for podman users
- MKNOD
- AUDIT_WRITE
# additional required cap for warp, both for podman and docker
- NET_ADMIN
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
- net.ipv4.conf.all.src_valid_mark=1
# uncomment for nat
# - net.ipv4.ip_forward=1
# - net.ipv6.conf.all.forwarding=1
# - net.ipv6.conf.all.accept_ra=2
volumes:
- ./data:/var/lib/cloudflare-warp
在xray中增加:
1、outbounds节点中增加:
{
"tag": "warp-out",
"protocol": "socks",
"settings": {
"servers": [
{
"address": "172.17.0.1",
"port": 1080
}
]
}
}
2、在routing-rules节点中增加:
{
"type": "field",
"domain": [
"openai.com",
"api.openai.com",
"chat.openai.com",
"oaistatic.com",
"oaiusercontent.com",
"x.ai",
"grok.x.ai"
],
"outboundTag": "warp-out"
}
注意此处访问172.17.0.1:1080可能访问不通,需要在宿主机执行以下命名:
sudo ufw allow from 172.17.0.0/16 to any port 1080
重启xray 的docker服务,即可使用了。
0