V2RAY双服务器代理配置

/ 运维 / 0 条评论 / 2290浏览

分别开启(国内,国外)两台服务器

配置国外服务器(IP :a.b.c.d)

{
  "log": {
    "access": "/etc/v2ray/access.log",
    "error": "/etc/v2ray/error.log",
    "loglevel": "debug"
  },
  "inbounds": [{
    "port": 443,
    "protocol": "vmess",
    "settings": {
      "clients": [
        { 
          "id": "0a7587ba-adff-4f07-8d33-0685d400e99a", //UUID 自行生成
          "level": 1,
          "alterId": 64
        }
      ]
    }
  }],
  "outbounds": [{
    "protocol": "freedom",
    "settings": {}
  },{
    "protocol": "blackhole",
    "settings": {},
    "tag": "blocked"
  }],
  "routing": {
    "rules": [
      { 
        "type": "field",
        "ip": ["geoip:private"],
        "outboundTag": "blocked"
      }
    ]
  }
}

启动国外代理

docker run -d --name v2ray -v /root/v2ray:/etc/v2ray -p 443:443 v2ray/official  v2ray -config=/etc/v2ray/config.json

配置国内服务器

{
  "log": {
    "access": "/etc/v2ray/access.log",
    "error": "/etc/v2ray/error.log",
    "loglevel": "debug"
  },
  "inbounds": [{
    "port": 443,
    "protocol": "socks",
    "userLevel": 0
  }],
  "outbounds": [{
    "protocol": "vmess",
    "settings": {
      "vnext": [{
        "address": "a.b.c.d",   //国外v2ray服务器的IP或域名
        "port": 443,
        "users": [{ "id": "0a7587ba-adff-4f07-8d33-0685d400e99a" }]  // 国外服务器配置的UUID
      }]
    }
  },{
    "protocol": "freedom",
    "tag": "direct",
    "settings": {}
  }],
  "routing": {
    "domainStrategy": "IPOnDemand",
    "rules": [{
      "type": "field",
      "ip": ["geoip:private"],
      "outboundTag": "direct"
    }]
  }
}
docker run -d --name v2ray -v /root/v2ray:/etc/v2ray -p 20000:443 v2ray/official  v2ray -config=/etc/v2ray/config.json