Add Cloudflare WARP to Xray server

Add Cloudflare WARP to Xray server

Install Cloudflare WARP

P3TERX/warp.sh: Cloudflare WARP Installer | WARP 一键安装脚本

Using the script above,

  1. Run bash <(curl -fsSL git.io/warp.sh) menu
  2. Install Cloudflare WARP and configure sock5 proxy.
  3. Upgrade to WARP Plus with warp-cli set-license {myLicense} (Attach the current registration to a different account using a license key).

Configure Xray config.

{
  "api": {
    "services": [
      "HandlerService",
      "LoggerService",
      "StatsService"
    ],
    "tag": "api"
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 62789,
      "protocol": "dokodemo-door",
      "settings": {
        "address": "127.0.0.1"
      },
      "tag": "api"
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    },
    {
      "tag": "chatGPT_proxy",
      "protocol": "socks",
      "settings": {
        "servers": [
          {
            "address": "127.0.0.1",
            "port": 40000
          }
        ]
      }
    },
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "policy": {
    "system": {
      "statsInboundDownlink": true,
      "statsInboundUplink": true
    }
  },
  "routing": {
    "rules": [
      {
        "type": "field",
        "outboundTag": "chatGPT_proxy",
        "domain": [
          "chat.openai.com"
        ]
      },
      {
        "user": [
          "my@mail.com"
        ],
        "outboundTag": "chatGPT_proxy",
        "type": "field"
      },
      {
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api",
        "type": "field"
      },
      {
        "ip": [
          "geoip:private"
        ],
        "outboundTag": "blocked",
        "type": "field"
      },
      {
        "outboundTag": "blocked",
        "protocol": [
          "bittorrent"
        ],
        "type": "field"
      }
    ]
  },
  "stats": {}
}