國內到我HE的小機線路峰值ping偏高,但是ip很清真,剛好我的HK小機的ISP和HE有transit 方案如下

  1. 使用UUID1鏈接中轉服務器,將流量路由到#1服務器
  2. 使用UUID2鏈接中轉服務器,將流量路由到#2服務器
  3. 使用UUID3鏈接中轉服務器,直接使用當前服務器訪問

服務器配置

末端服務器配置

參考Caddy/Nginx + V2Ray

中轉服務器

  "log": {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "warnings"
  },
   "inbounds": [
    {
      "port": 端口,
      "protocol": "vmess",
      "settings":{
        "clients": [
        {
          "id": "UUID1",
          "alterId": 16,
          "email": "Email1(隨意寫)"
        },
        {
          "id": "UUID2",
          "alterId": 16,
          "email": "Email2(隨意)"
        },
        {
          "id": "UUID3",
          "alterId": 16,
          "email": "Email3(隨意)"
        }
      ]
    },
    //鏈接中轉服務器的協議爲wss
      "streamSettings": {
        "network": "ws",
        "security": "auto",
        "wsSettings": {
          "path": "/你的path/",
          "connectionReuse":true,
          "headers":{
            "Host":"域名",
          }
        },
      "disableInsecureEncryption": true
    }
  }
],
  "outbound":{
  //使用UUID3,不進行中轉
      "protocol": "freedom",
      "settings": {}
    },
  "outboundDetour": [
    {
    //使用UUID1,路由至下一節點,下一節點使用普通tcp
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "你的ip",
            "port": 端口,
            "users": [
              {
                "id": "和下一節點一致",
                "alterId": 16,
                "security": "auto"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "none"
      },
      "tag": "tag1之後會用到"
    },
    //使用UUID2,路由至下一節點,採用wss
    {
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "域名",
            "port": 443,
            "users": [
              {
                "id": "和下一節點一致",
                "alterId": 16,
                "security": "auto"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "security": "tls",
        "wsSettings": {
          "connectionReuse":true,
          "path": "/你的path/",
          "headers":{
            "Host":"域名"
          }
        }
      },
      "tag": "tag2之後會用到,和上面的不一樣"
    }],
  "routing": {
  //路由策略
    "strategy": "rules",
    "settings": {
      "rules": [
        {
          "type": "field",
          "user": "和上面的Email1一致",
          "outboundTag": "上面寫的tag1"
        },
        {
          "type": "field",
          "user": "和上面的Email2一致",
          "outboundTag": "上面寫的tag2"
        }
      ]
    }
  }
}

Client

配置不同的uuid即可

測試

[ 4] local 10.82.1.54 port 5001 connected with port 39390 [ ID] Interval Transfer Bandwidth [ 4] 0.0-10.0 sec 96.6 MBytes 80.8 Mbits/sec [ 5] local 10.82.1.54 port 5001 connected with port 39398 [ 5] 0.0-10.0 sec 93.4 MBytes 78.0 Mbits/sec [ 4] local 10.82.1.54 port 5001 connected with port 39400 [ 4] 0.0-10.0 sec 102 MBytes 84.9 Mbits/sec

吐槽

英文單詞需要加s…

一定要记得

contribute

V2Ray 白话文教程 Project V