安装方法参考官方安装以下只给出配置文件
Cloudflare为域名解析和cdn加速可用可不用

v2ray服务端配置

{
  "outbound": {
    "streamSettings": null,
    "tag": null,
    "protocol": "freedom",
    "mux": null,
    "settings": null
  },
  "log": {
    "access": "/var/log/v2ray/access.log",
    "loglevel": "info",
    "error": "/var/log/v2ray/error.log"
  },
  "outboundDetour": [
    {
      "tag": "direct",
      "protocol": "freedom",
      "settings": null
    },
    {
      "tag": "blocked",
      "protocol": "blackhole",
      "settings": null
    }
  ],
  "inbound": {
    "streamSettings": {
      "network": "ws",
      "kcpSettings": null,
      "wsSettings": {
        "path": "/test"  //服务端客户端caddy需一致
      },
      "tcpSettings": null,
      "tlsSettings": {},
      "security": ""
    },
    "settings": {
      "ip": null,
      "udp": true,
      "clients": [
        {
          "alterId": 100,
          "security": "aes-128-gcm",
          "id": "e2b39859-7e9e-411b-a561-00904419bed9" //自行更改
        }
      ],
      "auth": null
    },
    "protocol": "vmess",
    "port": 39605,  //监听端口自行更改
    "listen": null
  },
  "inboundDetour": null,
  "routing": {
    "settings": {
      "rules": [
        {
          "ip": [
            "0.0.0.0/8",
            "10.0.0.0/8",
            "100.64.0.0/10",
            "127.0.0.0/8",
            "169.254.0.0/16",
            "172.16.0.0/12",
            "192.0.0.0/24",
            "192.0.2.0/24",
            "192.168.0.0/16",
            "198.18.0.0/15",
            "198.51.100.0/24",
            "203.0.113.0/24",
            "::1/128",
            "fc00::/7",
            "fe80::/10"
          ],
          "domain": null,
          "type": "field",
          "port": null,
          "outboundTag": "blocked"
        }
      ],
      "domainStrategy": null
    },
    "strategy": "rules"
  },
  "dns": null
}

caddy配置

tz.nuei.cn {
 root /usr/local/ServerStatus/web   #网站目录
 timeouts none
 tls andy@uxiai.com
 gzip
 proxy /test 127.0.0.1:39605 {      #/test需一致 
  websocket
  header_upstream -Origin
  }
}

v2ray客户端配置

  "inbound": {
    "port": 1086,
    "listen": "0.0.0.0",
    "protocol": "socks",
    "settings": {
      "auth": "noauth",
      "udp": true,
      "ip": "127.0.0.1",
      "clients": null
    },
    "streamSettings": null
  },
  "outbound": {
    "tag": "agentout",
    "protocol": "vmess",
    "settings": {
      "vnext": [
        {
          "address": "tz.nuei.cn",
          "port": 443,
          "users": [
            {
              "id": "e2b39859-7e9e-411b-a561-00904419bed9",  //自行更改
              "alterId": 100,
              "email": "t@t.tt",
              "security": "aes-128-gcm"
            }
          ]
        }
      ],
      "servers": null
    },
    "streamSettings": {
      "network": "ws",
      "security": "tls",
      "tlsSettings": {
        "allowInsecure": true,
        "serverName": null
      },
      "tcpSettings": null,
      "kcpSettings": null,
      "wsSettings": {
        "connectionReuse": true,
        "path": "/test",  //服务端客户端caddy需一致
        "headers": {
          "Host": "tz.nuei.cn"   //caddy域名
        }
      },
      "httpSettings": null
    },
    "mux": {
      "enabled": true
    }
  },
  "inboundDetour": null,
  "outboundDetour": [
    {
      "protocol": "freedom",
      "settings": {
        "response": null
      },
      "tag": "direct"
    },
    {
      "protocol": "blackhole",
      "settings": {
        "response": {
          "type": "http"
        }
      },
      "tag": "blockout"
    }
  ],
  "dns": {
    "servers": [
      "1.1.1.1",
      "8.8.8.8",
      "localhost"
    ]
  },
  "routing": {
    "strategy": "rules",
    "settings": {
      "domainStrategy": "IPIfNonMatch",
      "rules": [
        {
          "type": "field",
          "port": null,
          "outboundTag": "direct",
          "ip": [
            "0.0.0.0/8",
            "10.0.0.0/8",
            "100.64.0.0/10",
            "127.0.0.0/8",
            "169.254.0.0/16",
            "172.16.0.0/12",
            "192.0.0.0/24",
            "192.0.2.0/24",
            "192.168.0.0/16",
            "198.18.0.0/15",
            "198.51.100.0/24",
            "203.0.113.0/24",
            "::1/128",
            "fc00::/7",
            "fe80::/10"
          ],
          "domain": null
        }
      ]
    }
  }
}
如果觉得我的文章对你有用,请随意赞赏