• 欢迎访问笔记阁,实用快捷文章教程,推荐使用Chrome浏览器和360极速浏览器访问本网站
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏笔记阁吧

v2ray监控用户流量2020

运维干货 feko 7天前 135次浏览 已收录 0个评论 扫描二维码
  • 配置模式:单端口多用户,多端口多用户和tls伪装
# cat     /usr/local/etc/v2ray/config.json
{
 "stats": {},
 "log": {
    "loglevel": "info",
    "access": "/data/logs/v2ray/access.log",
    "error": "/data/logs/v2ray/error.log"
  },
   "api": {
        "tag": "api",
        "services": [
            "HandlerService",
            "LoggerService",
            "StatsService"
        ]
    },
    "policy": {
        "levels": {
            "0": {
                "statsUserUplink": true,
                "statsUserDownlink": true
            },
            "1": {
                "statsUserUplink": true,
                "statsUserDownlink": true
            }
        },
        "system": {
            "statsInboundUplink": true,
            "statsInboundDownlink": true
        }
    }, 

  "inbounds": [
{
    "tag": "v1st",
    "port": 12345,
    "listen":"127.0.0.1",
    "protocol": "vmess",
    "settings": {
      "clients": [
        { 
          "email": "xxx@qq.com",
          "id": "6e0d2296-8864-4d1c-bc40-030c0bdd9e9d",
          "level": 1,
          "alterId": 64
        },

        { 
          "email": "yyy@qq.com",
          "id": "0a44d0ca-782d-4836-8c92-4a9bada54376",
          "level": 1,
          "alterId": 64
        }
      ]
    },
    "streamSettings":{
       "network":"ws",
       "wsSettings":{
         "path":"/ws"
       }
    }
},

{
    "tag": "v2st",
    "port": 1122,
    "listen":"127.0.0.1",
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "email": "zzz@qq.com",
          "id": "8d09e775-3f49-4aab-b069-02bd015b0162",
          "level": 1,
          "alterId": 64
        }
      ]
    },
    "streamSettings":{
       "network":"ws",
       "wsSettings":{
         "path":"/ws001"     //对应上nginx上的配置
       }
    }
},

        {
            "listen": "127.0.0.1",
            "port": 8899,
            "protocol": "dokodemo-door",
            "settings": {
                "address": "127.0.0.1"
            },
            "tag": "api"
        }

],

  "outbounds": [
        {
            "protocol": "freedom",
            "settings": {}
        },
        {
            "protocol": "blackhole",
            "settings": {},
            "tag": "blocked"

        }
],
    "routing": {
        "settings": {
            "rules": [
                {
                    "inboundTag": [
                        "api"
                    ],
                    "outboundTag": "api",
                    "type": "field"
                }
            ]
        },
        "strategy": "rules"
    }

}

# systemctl resstart v2ray  ##重启v2ray
# cat  /usr/local/etc/v2ray/config.json  ##查看v2ray配置
# cat /proc/sys/kernel/random/uuid       ##用户uuid生成

# v2ctl api --server=127.0.0.1:8899  StatsService.GetStats 'name: "user>>>xxx@qq.com>>>traffic>>>downlink" reset: false'  ##查看用户下载流量
# v2ctl api --server=127.0.0.1:8899  StatsService.GetStats 'name: "user>>>xxx@qq.com>>>traffic>>>uplink" reset: false'    ##查看用户上传流量
# v2ctl api --server=127.0.0.1:8899 StatsService.QueryStats 'pattern: "" reset: false'                                    ##查看全部用户上传下载流量,默认fasle不清除记录 true是清除记录

笔记阁 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:v2ray监控用户流量2020
喜欢 (2)
发表我的评论
取消评论
表情 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址