Skip to content

下载

https://github.com/v2fly/v2ray-core/releases/tag/v5.41.0

https://github.com/v2fly/v2ray-core/releases/download/v5.41.0/v2ray-linux-64.zip

shell
Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         2025/11/5     17:30                systemd
-a----         2025/11/5     17:43           3263 config.json
------        2025/10/16     20:27         212559 geoip-only-cn-private.dat
------        2025/10/16     20:27       19843622 geoip.dat
------        2025/10/16     20:27        2339123 geosite.dat
------        2025/10/16     20:27       35639444 v2ray
------        2025/10/16     20:27            391 vpoint_socks_vmess.json
------        2025/10/16     20:27            537 vpoint_vmess_freedom.json

配置 config.json

json
{  
  "log": {
    "loglevel": "debug",
    "access": "access.log",
    "error": "error.log"
  },
  "inbounds": [
    {
      "port": 1080,
      "listen": "127.0.0.1",
      "protocol": "socks",
      "settings": {
        "udp": true
      }
    }
  ],
  "outbounds": [
    {
      "tag": "proxy",
      "protocol": "vless",
      "settings": {
        "vnext": [
          {
            "address": "YOUR SERVER ADDR",
            "port": YOUR PORT,
            "users": [
              {
                "id": "YOUR ID",
                "email": "t@t.tt",
                "security": "auto",
                "encryption": "none"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "tls",
        "tlsSettings": {
          "allowInsecure": false,
          "serverName": "vp.pursue.pub",
          "alpn": [
            "h3",
            "h2",
            "http/1.1"
          ],
          "fingerprint": "chrome"
        }
      },
      "mux": {
        "enabled": false,
        "concurrency": -1
      }
    }
  ],
  "routing": {
    "rules": [
      {
        "type": "field",
        "outboundTag": "proxy",
        "domain": [
          "domain:googleapis.cn",
          "domain:gstatic.com"
        ]
      },
      {
        "type": "field",
        "outboundTag": "direct",
        "ip": [
          "geoip:private"
        ]
      },
      {
        "type": "field",
        "outboundTag": "direct",
        "domain": [
          "geosite:private"
        ]
      },
      {
        "type": "field",
        "outboundTag": "direct",
        "domain": [
          "domain:alidns.com",
          "domain:doh.pub",
          "domain:dot.pub",
          "domain:360.cn",
          "domain:onedns.net"
        ]
      },
      {
        "type": "field",
        "outboundTag": "direct",
        "ip": [
          "geoip:cn"
        ]
      },     
      {
        "type": "field",
        "network": "tcp,udp",
        "outboundTag": "proxy"
      },
      {
        "type": "field",
        "outboundTag": "direct",
        "domain": [
          "geosite:cn"
        ]
      }
    ]
  }
}

启动

shell
echo "=== 启动 V2Ray ==="
nohup v2ray run &
V2RAY_PID=$!
echo "V2Ray 已在后台启动, PID: $V2RAY_PID"

echo "=== 代理环境变量已由 K8s 设置 ==="
echo "ALL_PROXY=$ALL_PROXY"

文章来源于自己总结和网络转载,内容如有任何问题,请大佬斧正!联系我