🌞

V2Ray中轉

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

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

服務器配置

末端服務器配置

參考Caddy/Nginx + V2Ray

中轉服務器

  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
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
  "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

updatedupdated2019-11-162019-11-16