最速搭梯教程

  1. 用随意的方法搞到一台 Linux 的 VPS
  2. 用包管理器或官方脚本安装 xray
  3. 用包管理器或官方脚本安装 caddy
  4. 在 Caddy 配置文件(一般在/etc/caddy/Caddyfile)中添加以下内容:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    你的域名: {

    @websockets {
    path /你想用的路径(例如 /websocket 等)
    header Connection Upgrade
    header Upgrade websocket
    }
    reverse_proxy @websockets 127.0.0.1:你喜欢的端口

    }
  5. 在 Xray 配置目录(一般在/etc/xray//usr/local/etc/xray/)中添加一个你喜欢的名字.json, 里面写如下内容:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    {
    "log": {
    "loglevel": "warning",
    },
    "inbounds": [{
    "port": 你喜欢的端口,
    "protocol": "vless",
    "settings": {
    "decryption": "none",
    "clients": [
    {
    "id": "随便上什么地方生成一个uuid",
    "level": 0
    }
    ]
    },
    "streamSettings": {
    "network":"ws",
    "security": "none",
    "wsSettings":{
    "path":"/你想用的路径",
    "headers":{}
    }
    }
    }],
    "outbounds": [{
    "protocol": "freedom",
    "settings": {}
    },{
    "protocol": "blackhole",
    "settings": {},
    "tag": "blocked"
    }],
    "routing": {
    "rules": [
    {
    "type": "field",
    "ip": ["geoip:private"],
    "outboundTag": "blocked"
    }
    ]
    }
    }
  6. 终端输入systemctl enable --now caddy.service
  7. 终端输入systemctl enable --now xray@你喜欢的名字.service
  8. 别忘了把上面的汉字都换了,相同的汉字换成相同的内容
  9. 别忘了去改 DNS 解析
  10. VLESS + TLS + Websocket 搭 完 了