#! /bin/sh -
 
name=`basename $0 .sh`
case $1 in
 us1)
        echo "start us1-LA()..."
        service v2ray stop
        unlink /etc/v2ray/config.json
        cp /home/kele/Desktop/v2ray/v2ray-us1.json /etc/v2ray/config.json
        service v2ray start
        ;;
 us2)
        echo "start us2-LA() ..."
        service v2ray stop
        unlink /etc/v2ray/config.json
        cp /home/kele/Desktop/v2ray/v2ray-us2.json /etc/v2ray/config.json
        service v2ray start
        ;;
。。。。。。。。。。
        
 *)
        echo "Usage: sudo $name.sh [us1|us2|nj1|nj2|jp|tw]"
        exit 1
        ;;
esac
exit 0

V2RAY的客户端配置json

{
  "dns": {
    "servers": [
      "1.1.1.1"
    ]
  },
  "inbounds": [
    {
      "port": 10808,
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": true,
        "userLevel": 8
      },
      "sniffing": {
        "destOverride": [
          "http",
          "tls"
        ],
        "enabled": true
      },
      "tag": "socks"
    },
    {
      "port": 10809,
      "protocol": "http",
      "settings": {
        "userLevel": 8
      },
      "tag": "http"
    }
  ],
  "log": {
    "loglevel": "warning"
  },
  "outbounds": [
    {
      "mux": {
        "enabled": false
      },
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "域名",
            "port": 443,
            "users": [
              {
                "alterId": 64,
                "id": "自己的ID",
                "level": 8,
                "security": "auto"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "security": "tls",
        "tlssettings": {
          "allowInsecure": true,
          "serverName": ""
        },
        "wssettings": {
          "connectionReuse": true,
          "headers": {
            "Host": ""
          },
          "path": "/自定义的PATH/"
        }
      },
      "tag": "proxy"
    },
    {
      "protocol": "freedom",
      "settings": {},
      "tag": "direct"
    },
    {
      "protocol": "blackhole",
      "settings": {
        "response": {
          "type": "http"
        }
      },
      "tag": "block"
    }
  ],
  "policy": {
    "levels": {
      "8": {
        "connIdle": 300,
        "downlinkOnly": 1,
        "handshake": 4,
        "uplinkOnly": 1
      }
    },
    "system": {
      "statsInboundUplink": true,
      "statsInboundDownlink": true
    }
  },
  "routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": []
  },
  "stats": {}
}

标签: none

添加新评论