v2ray的搭建

官方模板:https://github.com/v2fly/v2ray-examples
最络容器部署:https://hub.docker.com/r/teddysun/v2ray

1.docker-compose.yml的配置

version: "3"

services:
  v2ray:
    #image: v2ray/official
    image: teddysun/v2ray
    container_name: v2ray
    restart: always
    ports:
      - "45368:45368"
      - "45369:45369"
    volumes:
      - ./data:/etc/v2ray
      - ./v2ray.config.json:/etc/v2ray/config.json:ro

2.v2ray.config.json的配置

{
  "inbound": {
    "port": 45368,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "bda8368e-b622-4cb6-9833-dc3f9881344f",
          "level": 1,
          "alterId": 233
        }
      ]
    }
  },
  "outbound": {
    "protocol": "freedom",
    "settings": {}
  },
  "inbounddetour": [
    {
      "protocol": "shadowsocks", 
      "port": 45369, 
      "settings": {
        "method": "aes-256-cfb",
        "password": "xxxxx",     
        "udp": false            
      }
    }
  ],
  "outbounddetour": [
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "routing": {
    "strategy": "rules",
    "settings": {
      "rules": [
        {
          "type": "field",
          "ip": [
            "0.0.0.0/8",
            "10.0.0.0/8",
            "100.64.0.0/10",
            "127.0.0.0/8",
            "169.254.0.0/16",
            "172.16.0.0/12",
            "192.0.0.0/24",
            "192.0.2.0/24",
            "192.168.0.0/16",
            "198.18.0.0/15",
            "198.51.100.0/24",
            "203.0.113.0/24",
            "::1/128",
            "fc00::/7",
            "fe80::/10"
          ],
          "outboundtag": "blocked"
        }
      ]
    }
  }
}

3.客户端配置【默认是Sock5代理】


4.谷歌SwitchyOmega插件的配置