VPS设置CloudFlare为落地(x-ui和hysteria2协议)

配置VPS的落地为CloudFlare的ip✌️

安装并配置warp

#官方教程:https://pkg.cloudflareclient.com/install
#安装WARP仓库GPG 密钥:

curl https://pkg.cloudflareclient.com/pubkey.gpg | sudo gpg --yes --dearmor --output /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg

#添加WARP源:

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/cloudflare-client.list

#更新APT缓存:

apt-get update

#安装WARP:

apt install cloudflare-warp

#注册WARP:

warp-cli register

#设置为代理模式(一定要先设置):

warp-cli set-mode proxy

#改变warp的默认端口

warp-cli set-proxy-port 16801

#连接WARP:

warp-cli connect

#查询代理后的IP地址:

curl ifconfig.me --proxy socks5://127.0.0.1:16801

x-ui可用的配置

{
  "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": "socks",
      "settings": {
        "servers": [
          {
            "address": "127.0.0.1",
            "port": 16801
          }
        ]
      }
    },
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "policy": {
    "levels": {
      "0": {
        "handshake": 10,
        "connIdle": 100,
        "uplinkOnly": 2,
        "downlinkOnly": 3,
        "statsUserUplink": true,
        "statsUserDownlink": true,
        "bufferSize": 10240
      }
    },
    "system": {
      "statsInboundDownlink": true,
      "statsInboundUplink": true
    }
  },
  "routing": {
    "rules": [
      {
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api",
        "type": "field"
      },
      {
        "ip": [
          "geoip:private"
        ],
        "outboundTag": "blocked",
        "type": "field"
      },
      {
        "outboundTag": "blocked",
        "protocol": [
          "bittorrent"
        ],
        "type": "field"
      }
    ]
  },
  "stats": {}
}

hysteria2可用的配置

outbounds:
  - name: warp
    type: socks5
    socks5:
      addr: 127.0.0.1:16801
  - name: v6
    type: direct
    direct:
      mode: 6

acl:
  inline:
   - v6(::/0)
   - warp(0.0.0.0/0)
   - direct(all)

就酱紫咯✌️

留下评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注