Merge pull request #128 from boypt/dev

增加流量统计查看功能
pull/132/head
233boy 6 years ago committed by GitHub
commit 93a789bd28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      config/client/h2.json
  2. 8
      config/client/http.json
  3. 8
      config/client/kcp.json
  4. 8
      config/client/quic.json
  5. 8
      config/client/tcp.json
  6. 8
      config/client/ws.json
  7. 8
      config/client/ws_tls.json
  8. 48
      config/server/dynamic/http.json
  9. 48
      config/server/dynamic/kcp.json
  10. 48
      config/server/dynamic/quic.json
  11. 48
      config/server/dynamic/tcp.json
  12. 48
      config/server/dynamic/ws.json
  13. 48
      config/server/h2.json
  14. 48
      config/server/http.json
  15. 1
      config/server/include/socks.json
  16. 1
      config/server/include/ss.json
  17. 48
      config/server/kcp.json
  18. 48
      config/server/quic.json
  19. 48
      config/server/tcp.json
  20. 48
      config/server/ws.json
  21. 11
      src/download-ssray.sh
  22. 8
      src/ss-info.sh
  23. 6
      src/ssray.conf
  24. 33
      src/v2ray-traffic.sh
  25. 19
      src/vmess-config.sh
  26. 133
      v2ray.sh

@ -9,12 +9,12 @@
"settings": {
"vnext": [
{
"address": "233blog.com",
"port": 2333,
"address": "__VMADDR__",
"port": __VMPORT__,
"users": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"alterId": 233,
"id": "__VMUSERID__",
"alterId": __VMALTID__,
"security": "auto"
}
]
@ -26,9 +26,9 @@
"security": "tls",
"httpSettings": {
"host": [
"233blog.com"
"__H2DOMAIN__"
],
"path": "/233blog"
"path": "__H2PATH__"
}
},
"mux": {

@ -9,12 +9,12 @@
"settings": {
"vnext": [
{
"address": "233blog.com",
"port": 2333,
"address": "__VMADDR__",
"port": __VMPORT__,
"users": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"alterId": 233,
"id": "__VMUSERID__",
"alterId": __VMALTID__,
"security": "auto"
}
]

@ -9,12 +9,12 @@
"settings": {
"vnext": [
{
"address": "233blog.com",
"port": 2333,
"address": "__VMADDR__",
"port": __VMPORT__,
"users": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"alterId": 233,
"id": "__VMUSERID__",
"alterId": __VMALTID__,
"security": "auto"
}
]

@ -9,12 +9,12 @@
"settings": {
"vnext": [
{
"address": "233blog.com",
"port": 2333,
"address": "__VMADDR__",
"port": __VMPORT__,
"users": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"alterId": 233,
"id": "__VMUSERID__",
"alterId": __VMALTID__,
"security": "auto"
}
]

@ -9,12 +9,12 @@
"settings": {
"vnext": [
{
"address": "233blog.com",
"port": 2333,
"address": "__VMADDR__",
"port": __VMPORT__,
"users": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"alterId": 233,
"id": "__VMUSERID__",
"alterId": __VMALTID__,
"security": "auto"
}
]

@ -9,12 +9,12 @@
"settings": {
"vnext": [
{
"address": "233blog.com",
"port": 2333,
"address": "__VMADDR__",
"port": __VMPORT__,
"users": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"alterId": 233,
"id": "__VMUSERID__",
"alterId": __VMALTID__,
"security": "auto"
}
]

@ -9,12 +9,12 @@
"settings": {
"vnext": [
{
"address": "233blog.com",
"port": 2333,
"address": "__VMADDR__",
"port": __VMPORT__,
"users": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"alterId": 233,
"id": "__VMUSERID__",
"alterId": __VMALTID__,
"security": "auto"
}
]

@ -1,4 +1,29 @@
{
"stats": {},
"api": {
"tag": "api",
"services": [
"HandlerService",
"LoggerService",
"StatsService"
]
},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true
},
"1": {
"statsUserUplink": true,
"statsUserDownlink": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true
}
},
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
@ -6,14 +31,24 @@
},
"inbounds": [
{
"port": 2333,
"listen": "127.0.0.1",
"port": 10086,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
},
{
"tag": "vmess-in",
"port": __VMPORT__,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "__VMUSERID__",
"level": 1,
"alterId": 233
"alterId": __VMALTID__
}
],
"detour": {
@ -129,6 +164,13 @@
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"type": "field",
"ip": [

@ -1,4 +1,29 @@
{
"stats": {},
"api": {
"tag": "api",
"services": [
"HandlerService",
"LoggerService",
"StatsService"
]
},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true
},
"1": {
"statsUserUplink": true,
"statsUserDownlink": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true
}
},
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
@ -6,14 +31,24 @@
},
"inbounds": [
{
"port": 2333,
"listen": "127.0.0.1",
"port": 10086,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
},
{
"tag": "vmess-in",
"port": __VMPORT__,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "__VMUSERID__",
"level": 1,
"alterId": 233
"alterId": __VMALTID__
}
],
"detour": {
@ -101,6 +136,13 @@
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"type": "field",
"ip": [

@ -1,4 +1,29 @@
{
"stats": {},
"api": {
"tag": "api",
"services": [
"HandlerService",
"LoggerService",
"StatsService"
]
},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true
},
"1": {
"statsUserUplink": true,
"statsUserDownlink": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true
}
},
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
@ -6,14 +31,24 @@
},
"inbounds": [
{
"port": 2333,
"listen": "127.0.0.1",
"port": 10086,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
},
{
"tag": "vmess-in",
"port": __VMPORT__,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "__VMUSERID__",
"level": 1,
"alterId": 233
"alterId": __VMALTID__
}
],
"detour": {
@ -105,6 +140,13 @@
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"type": "field",
"ip": [

@ -1,4 +1,29 @@
{
"stats": {},
"api": {
"tag": "api",
"services": [
"HandlerService",
"LoggerService",
"StatsService"
]
},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true
},
"1": {
"statsUserUplink": true,
"statsUserDownlink": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true
}
},
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
@ -6,14 +31,24 @@
},
"inbounds": [
{
"port": 2333,
"listen": "127.0.0.1",
"port": 10086,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
},
{
"tag": "vmess-in",
"port": __VMPORT__,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "__VMUSERID__",
"level": 1,
"alterId": 233
"alterId": __VMALTID__
}
],
"detour": {
@ -88,6 +123,13 @@
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"type": "field",
"ip": [

@ -1,4 +1,29 @@
{
"stats": {},
"api": {
"tag": "api",
"services": [
"HandlerService",
"LoggerService",
"StatsService"
]
},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true
},
"1": {
"statsUserUplink": true,
"statsUserDownlink": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true
}
},
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
@ -6,14 +31,24 @@
},
"inbounds": [
{
"port": 2333,
"listen": "127.0.0.1",
"port": 10086,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
},
{
"tag": "vmess-in",
"port": __VMPORT__,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "__VMUSERID__",
"level": 1,
"alterId": 233
"alterId": __VMALTID__
}
],
"detour": {
@ -91,6 +126,13 @@
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"type": "field",
"ip": [

@ -1,4 +1,29 @@
{
"stats": {},
"api": {
"tag": "api",
"services": [
"HandlerService",
"LoggerService",
"StatsService"
]
},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true
},
"1": {
"statsUserUplink": true,
"statsUserDownlink": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true
}
},
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
@ -6,14 +31,24 @@
},
"inbounds": [
{
"port": 2333,
"listen": "127.0.0.1",
"port": 10086,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
},
{
"tag": "vmess-in",
"port": __VMPORT__,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "__VMUSERID__",
"level": 1,
"alterId": 233
"alterId": __VMALTID__
}
]
},
@ -84,6 +119,13 @@
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"type": "field",
"ip": [

@ -1,4 +1,29 @@
{
"stats": {},
"api": {
"tag": "api",
"services": [
"HandlerService",
"LoggerService",
"StatsService"
]
},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true
},
"1": {
"statsUserUplink": true,
"statsUserDownlink": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true
}
},
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
@ -6,14 +31,24 @@
},
"inbounds": [
{
"port": 2333,
"listen": "127.0.0.1",
"port": 10086,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
},
{
"tag": "vmess-in",
"port": __VMPORT__,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "__VMUSERID__",
"level": 1,
"alterId": 233
"alterId": __VMALTID__
}
]
},
@ -102,6 +137,13 @@
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"type": "field",
"ip": [

@ -1,4 +1,5 @@
{
"tag": "socks-in",
"protocol": "socks",
"port": 6666,
"settings": {

@ -1,4 +1,5 @@
{
"tag": "ss-in",
"protocol": "shadowsocks",
"port": 6666,
"settings": {

@ -1,4 +1,29 @@
{
"stats": {},
"api": {
"tag": "api",
"services": [
"HandlerService",
"LoggerService",
"StatsService"
]
},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true
},
"1": {
"statsUserUplink": true,
"statsUserDownlink": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true
}
},
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
@ -6,14 +31,24 @@
},
"inbounds": [
{
"port": 2333,
"listen": "127.0.0.1",
"port": 10086,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
},
{
"tag": "vmess-in",
"port": __VMPORT__,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "__VMUSERID__",
"level": 1,
"alterId": 233
"alterId": __VMALTID__
}
]
},
@ -74,6 +109,13 @@
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"type": "field",
"ip": [

@ -1,4 +1,29 @@
{
"stats": {},
"api": {
"tag": "api",
"services": [
"HandlerService",
"LoggerService",
"StatsService"
]
},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true
},
"1": {
"statsUserUplink": true,
"statsUserDownlink": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true
}
},
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
@ -6,14 +31,24 @@
},
"inbounds": [
{
"port": 2333,
"listen": "127.0.0.1",
"port": 10086,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
},
{
"tag": "vmess-in",
"port": __VMPORT__,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "__VMUSERID__",
"level": 1,
"alterId": 233
"alterId": __VMALTID__
}
]
},
@ -76,6 +111,13 @@
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"type": "field",
"ip": [

@ -1,4 +1,29 @@
{
"stats": {},
"api": {
"tag": "api",
"services": [
"HandlerService",
"LoggerService",
"StatsService"
]
},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true
},
"1": {
"statsUserUplink": true,
"statsUserDownlink": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true
}
},
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
@ -6,14 +31,24 @@
},
"inbounds": [
{
"port": 2333,
"listen": "127.0.0.1",
"port": 10086,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
},
{
"tag": "vmess-in",
"port": __VMPORT__,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "__VMUSERID__",
"level": 1,
"alterId": 233
"alterId": __VMALTID__
}
]
},
@ -69,6 +104,13 @@
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"type": "field",
"ip": [

@ -1,4 +1,29 @@
{
"stats": {},
"api": {
"tag": "api",
"services": [
"HandlerService",
"LoggerService",
"StatsService"
]
},
"policy": {
"levels": {
"0": {
"statsUserUplink": true,
"statsUserDownlink": true
},
"1": {
"statsUserUplink": true,
"statsUserDownlink": true
}
},
"system": {
"statsInboundUplink": true,
"statsInboundDownlink": true
}
},
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
@ -6,14 +31,24 @@
},
"inbounds": [
{
"port": 2333,
"listen": "127.0.0.1",
"port": 10086,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
},
{
"tag": "vmess-in",
"port": __VMPORT__,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "__VMUSERID__",
"level": 1,
"alterId": 233
"alterId": __VMALTID__
}
]
},
@ -69,6 +104,13 @@
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"type": "field",
"ip": [

@ -37,7 +37,7 @@ _install_ssray_service() {
if [[ $systemd ]]; then
install -m644 /etc/v2ray/233boy/v2ray/src/ssray.service "/lib/systemd/system/"
install -m644 /etc/v2ray/233boy/v2ray/src/ssray.conf /etc/v2ray/
sed -i "s/##REMOTEPORT##/${ssrayport}/; s/##LOCALPORT##/${ssport}/; s/##OPTION##/${ssrayopt}/;" /etc/v2ray/ssray.conf
sed -i "s/__REMOTEPORT__/${ssrayport}/; s/__LOCALPORT__/${ssport}/; s/__OPTION__/${ssrayopt}/;" /etc/v2ray/ssray.conf
systemctl enable ssray
else
$red 暂时不资瓷...$none
@ -54,7 +54,7 @@ _update_ssray_version() {
_download_ssray_file
do_service restart ssray
echo
echo -e " $green 更新成功啦...当前 V2Ray 版本: ${cyan}$ssray_latest_ver$none"
echo -e " $green 更新成功啦...当前 V2Ray plugin 版本: ${cyan}$ssray_latest_ver$none"
echo
echo -e " $yellow 温馨提示: 为了避免出现莫名其妙的问题...V2Ray 客户端的版本最好和服务器的版本保持一致$none"
echo
@ -65,3 +65,10 @@ _update_ssray_version() {
fi
}
_uninstall_ssray() {
if [[ $systemd ]]; then
systemctl disable ssray
rm -f "/lib/systemd/system/ssray.service" /etc/v2ray/ssray.conf
fi
rm -f /usr/local/bin/v2ray-plugin
}

@ -22,7 +22,13 @@ if [[ $shadowsocks ]]; then
echo -e "$yellow SS 链接 = ${cyan}$ss$none"
echo
if [[ $ssray ]]; then
echo -e "$yellow SS + V2ray - Plugin 链接 = ${cyan}$ssplugin$none"
echo -e "$yellow SS + V2ray - Plugin 地址 = ${cyan}${ssray_domain}$none"
echo
echo -e "$yellow SS + V2ray - Plugin 端口 = ${cyan}${ssrayport}$none"
echo
echo -e "$yellow SS + V2ray - Plugin 参数 = ${cyan}${clientopt}$none"
echo
echo -e "$yellow SS + V2ray - Plugin 链接 = ${cyan}${ssplugin}$none"
echo
fi
echo -e "提示: 输入$cyan v2ray ssqr $none可生成 Shadowsocks 二维码链接"

@ -1,5 +1,5 @@
SS_REMOTE_HOST=0.0.0.0
SS_REMOTE_PORT=##REMOTEPORT##
SS_REMOTE_PORT=__REMOTEPORT__
SS_LOCAL_HOST=127.0.0.1
SS_LOCAL_PORT=##LOCALPORT##
SS_PLUGIN_OPTIONS="##OPTION##"
SS_LOCAL_PORT=__LOCALPORT__
SS_PLUGIN_OPTIONS="__OPTION__"

@ -0,0 +1,33 @@
_V2CTL=/usr/bin/v2ray/v2ctl
_APISERVER=127.0.0.1:10086
v2_inbound() {
local inbound=$1
local direct=$2
$_V2CTL api --server=$_APISERVER StatsService.GetStats "name: \"inbound>>>${inbound}>>>traffic>>>${direct}\"" \
| awk '{
if (match($1, /name:/)){ f=1; gsub(/"$/, "", $2); split($2, p, ">>>"); print p[2]":"p[4] }
else if (match($1, /value:/)){ f=0; print $2}
else if (match($0, /^>$/) && f == 1) print "0"
else {}
}' \
| sed '$!N;s/\n/ /; s/link//' \
| numfmt --field=2 --suffix=B --to=iec \
| sort \
| column -t
}
v2_query_all () {
$_V2CTL api --server=$_APISERVER StatsService.QueryStats '' \
| awk '{
if (match($1, /name:/)){ f=1; gsub(/"$/, "", $2); split($2, p, ">>>"); print p[2]":"p[4] }
else if (match($1, /value:/)){ f=0; print $2}
else if (match($0, /^>$/) && f == 1) print "0"
else {}
}' \
| sed '$!N;s/\n/ /; s/link//' \
| numfmt --field=2 --suffix=B --to=iec \
| sort \
| column -t
}

@ -55,7 +55,7 @@ cp -f $v2ray_server_config_file $v2ray_server_config
cp -f $v2ray_client_config_file $v2ray_client_config
# change port, uuid, alterId
sed -i "9s/2333/$v2ray_port/; 14s/$old_id/$v2ray_id/; 16s/233/$alterId/" $v2ray_server_config
sed -i "s/__VMPORT__/$v2ray_port/; s/__VMUSERID__/$v2ray_id/; s/__VMALTID__/$alterId/" $v2ray_server_config
# change dynamic port
if [[ $v2ray_transport -ge 18 ]]; then
@ -66,11 +66,11 @@ fi
# change domain and path, or header type
case $v2ray_transport in
5)
sed -i "24s/233blog.com/$domain/" $v2ray_server_config
sed -i "s/__H2DOMAIN__/$domain/" $v2ray_server_config
if [[ $is_path ]]; then
sed -i "26s/233blog/$path/" $v2ray_server_config
sed -i "s/__H2PATH__/$path/" $v2ray_server_config
else
sed -i "26s/233blog//" $v2ray_server_config
sed -i "s/__H2PATH__//" $v2ray_server_config
fi
;;
7 | 13 | 22 | 28)
@ -95,17 +95,16 @@ case $v2ray_transport in
;;
esac
## change client config file
# change client config file
[[ -z $ip ]] && get_ip
sed -i "s/__VMADDR__/$ip/; s/__VMPORT__/$v2ray_port/; s/__VMUSERID__/$v2ray_id/; s/__VMALTID__/$alterId/" $v2ray_client_config
if [[ $v2ray_transport == [45] ]]; then
sed -i "s/233blog.com/$domain/; 13s/2333/443/; 16s/$old_id/$v2ray_id/; 17s/233/$alterId/" $v2ray_client_config
sed -i "s/__H2DOMAIN__/$domain/" $v2ray_client_config
if [[ $is_path ]]; then
sed -i "31s/233blog/$path/" $v2ray_client_config
sed -i "s/__H2PATH__/$path/" $v2ray_client_config
else
sed -i "31s/233blog//" $v2ray_client_config
sed -i "s/__H2PATH__//" $v2ray_client_config
fi
else
sed -i "s/233blog.com/$ip/; 13s/2333/$v2ray_port/; 16s/$old_id/$v2ray_id/; 17s/233/$alterId/" $v2ray_client_config
fi
# zip -q -r -j --password "233blog.com" /etc/v2ray/233blog_v2ray.zip $v2ray_client_config

@ -33,6 +33,7 @@ if [[ -f /usr/bin/yum ]]; then
fi
backup="/etc/v2ray/233blog_v2ray_backup.conf"
ssraybackup="/etc/v2ray/233blog_ssray_backup.conf"
if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup && -d /etc/v2ray/233boy/v2ray ]]; then
@ -57,6 +58,8 @@ if [[ $path_status ]]; then
is_path=true
fi
[[ -f $ssraybackup ]] && source $ssraybackup
uuid=$(cat /proc/sys/kernel/random/uuid)
old_id="e55c8d17-2cf3-b21a-bcf1-eeacb011ed79"
v2ray_server_config="/etc/v2ray/config.json"
@ -89,6 +92,12 @@ else
caddy_run_status="$red未在运行$none"
fi
ssray_transports=(
"HTTP (Websocket)"
"HTTPS (Websocket TLS)"
"QUIC (udp)"
)
_load transport.sh
ciphers=(
aes-128-cfb
@ -143,6 +152,13 @@ create_vmess_URL_config() {
EOF
fi
}
view_v2ray_traffic() {
_load v2ray-traffic.sh
echo
echo
v2_query_all
echo
}
view_v2ray_config_info() {
_load v2ray-info.sh
@ -620,8 +636,6 @@ ssray_config() {
echo -e " $red大佬...你没有配置 Shadowsocks - V2ray - Plugin $none...不过现在想要配置的话也是可以的 ^_^"
echo
echo
echo -e " $yellow 唉唉 现在不管有没有配置过都要重新配置的,脚本还没完善好这部分,想改就接着重新配置吧~$none..."
echo
while :; do
echo -e "是否配置 ${yellow}Shadowsocks - V2ray Plugin ${none} [${magenta}Y/N$none]"
@ -638,6 +652,7 @@ ssray_config() {
echo
ssray=true
ssray_port_config
ssray_proto_config
break
elif [[ "$install_ssray" == [Nn] ]]; then
break
@ -646,6 +661,11 @@ ssray_config() {
fi
done
_download_ssray_file
ssray_apply_config
ssray_save_config
_load ss-info.sh
}
ssray_port_config() {
@ -666,9 +686,6 @@ ssray_port_config() {
error
;;
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
if [[ $v2ray_transport == [45] ]]; then
local tls=ture
fi
if [[ $tls && $ssrayport == "80" ]] || [[ $tls && $ssrayport == "443" ]]; then
echo
echo -e "由于你已选择了 "$green"WebSocket + TLS $none或$green HTTP/2"$none" 传输协议."
@ -700,17 +717,10 @@ ssray_port_config() {
esac
done
ssray_proto_config
}
ssray_proto_config() {
ssray_transports=(
"HTTP (Websocket)"
"HTTPS (Websocket TLS)"
"QUIC (udp)"
)
echo
while :; do
echo -e "请选择 "$yellow"V2Ray-Plugin"$none" 传输协议 [${magenta}1-${#transport[*]}$none]"
@ -781,6 +791,10 @@ ssray_proto_config() {
echo -e "$yellow 噫!好像已经有证书了! 皮皮虾咋们走! $none"
else
echo -e "$yellow 开始安装acme.sh $none"
if ! command -v socat; then
echo -e "$red 需要安装socat $none"
exit 1
fi
curl https://get.acme.sh | bash
echo -e "$yellow 开始申请 $ssray_domain 的证书,如果有正在使用80端口的程序先让它们退下~... $none"
@ -800,19 +814,87 @@ ssray_proto_config() {
}
change_ssray_config() {
_load download-ssray.sh
if [[ $ssray ]]; then
while :; do
echo
echo -e "$yellow 1. $none修改 Shadowsocks - V2ray插件 端口"
echo
echo -e "$yellow 2. $none修改 Shadowsocks - V2ray插件 协议"
echo
echo -e "$yellow 3. $none升级 Shadowsocks - V2ray插件"
echo
echo -e "$yellow 4. $none关闭 Shadowsocks - V2ray"
echo
read -p "$(echo -e "请选择 [${magenta}1-3$none]:")" _opt
if [[ -z $_opt ]]; then
error
else
ssray_config
_load download-ssray.sh
_download_ssray_file
_install_ssray_service
case $_opt in
1)
local oldssrayport=$ssrayport
ssray_port_config
ssray_save_config
ssray_apply_config
del_port $oldssrayport
open_port $ssrayport
do_service restart ssray
_load ss-info.sh
break
;;
2)
ssray_proto_config
ssray_save_config
ssray_apply_config
_load ss-info.sh
break
;;
3)
_update_ssray_version
ssray_save_config
break
;;
4)
del_port $ssrayport
_uninstall_ssray
ssray=
install_ssray=n
rm -f $ssraybackup
break
;;
*)
error
;;
esac
fi
done
else
ssray_config
fi
}
ssray_save_config() {
cat > $ssraybackup << EOF
install_ssray=${install_ssray}
ssray_ver="$ssray_latest_ver"
ssray=${ssray}
ssray_transport=${ssray_transport}
ssrayport=${ssrayport}
ssray_domain="${ssray_domain}"
ssrayopt="${ssrayopt}"
EOF
}
ssray_apply_config() {
_install_ssray_service
open_port $ssrayport
do_service restart ssray
}
change_v2ray_config() {
local _menu=(
@ -2609,6 +2691,12 @@ update() {
update_v2ray() {
_load download-v2ray.sh
_update_v2ray_version
if [[ $ssray ]]; then
_load download-ssray.sh
_update_ssray_version
ssray_save_config
fi
}
update_v2ray.sh() {
if [[ $_test ]]; then
@ -2802,6 +2890,8 @@ _help() {
${green}v2ray update $none更新 V2Ray
${green}v2ray traffic $none查看 V2Ray 流量
${green}v2ray update.sh $none更新 V2Ray 管理脚本
${green}v2ray uninstall $none卸载 V2Ray
@ -2847,6 +2937,8 @@ menu() {
echo
echo -e "$yellow 11. $none其他"
echo
echo -e "$yellow 12. $none查看 V2ray 流量统计"
echo
echo -e "温馨提示...如果你不想执行选项...按$yellow Ctrl + C $none即可退出"
echo
read -p "$(echo -e "请选择菜单 [${magenta}1-9$none]:")" choose
@ -2900,6 +2992,10 @@ menu() {
other
break
;;
12)
view_v2ray_traffic
break
;;
*)
error
;;
@ -3030,6 +3126,9 @@ v | version)
bbr)
other
;;
traffic)
view_v2ray_traffic
;;
help | *)
_help
;;

Loading…
Cancel
Save