# multi-v2ray
V2ray/Xray多用户管理脚本,向导式管理[新增|删除|修改]传输协议
![](https://img.shields.io/pypi/v/v2ray-util.svg)
[![Downloads](https://pepy.tech/badge/v2ray-util)](https://pepy.tech/project/v2ray-util)
[![Downloads](https://pepy.tech/badge/v2ray-util/month)](https://pepy.tech/project/v2ray-util)
![](https://img.shields.io/docker/pulls/jrohy/v2ray.svg)
![](https://img.shields.io/github/license/Jrohy/multi-v2ray.svg)
## [中文](README.md) [English](README_EN.md)
## 特色
- [x] 支持Xray管理, v2ray和xray相互独立, 不同命令(v2ray/xray)进入不同的core管理
- [x] 调用v2ray官方api进行流量统计
- [x] **多用户, 多端口管理**, 混合传输协议管理不再是梦
- [x] 首次安装时产生随机端口,默认配置mkcp + 随机一种 (srtp | wechat-video | utp | dtls | wireguard) header伪装;
安装完成显示配置信息;
- [x] 查看配置信息显示vmess/vless字符串(v2rayN的分享链接格式)
- [x] 生成**Telegram**的socks5/MTProto分享链接, 支持socks5 + tls组合
- [x] 支持http/2, 随机生成伪装h2 path
- [x] 开启关闭tcpFastOpen
- [x] 直接开启[CDN](https://github.com/Jrohy/multi-v2ray/wiki/CloudFlare-cdn%E4%BB%A3%E7%90%86v2ray%E6%B5%81%E9%87%8F)
- [x] 开启关闭动态端口
- [x] 定时更新v2ray(需手动开启)
- [x] 支持新版v2ray配置文件格式(v4.1+)
- [x] 支持范围端口修改
- [x] 支持程序和**命令行参数**管理控制
- [x] 支持docker部署
- [x] 支持VLESS和Trojan以及XTLS(v4.31.0+)
- [x] 支持纯ipv6 vps
- [x] 禁止BT
## 功能
- 一键 启动 / 停止 / 重启 V2ray 服务端
- 流量统计(v2ray && iptables)
- 命令行模式管理v2ray
- 支持多用户, 多端口管理
- 开启关闭动态端口
- bittorrent的禁止与放行
- 单端口, 范围端口的修改
- 直接走Cloudcflare cdn
- 开启关闭tcpFastOpen
- 快速查看服务器连接信息, 常规配置修改
- 自由更改**传输配置**:
- 常规TCP
- HTTP头部伪装
- WebSocket流量
- 常规mKCP流量
- mKCP 伪装 FaceTime通话流量(srtp)
- mKCP 伪装 BT下载流量(utp)
- mKCP 伪装 微信视频通话流量(wechat-video)
- mKCP 伪装 DTLS 1.2流量(dtls)
- mKCP 伪装 WireGuard流量(wireguard)
- HTTP/2的tls流量(h2)(需备域名)
- Socks5
- MTProto
- Shadowsocks
- Quic
- VLESS_TCP
- VLESS_TLS
- VLESS_WS
- VLESS_REALITY
- Trojan
## 安装命令
```
source <(curl -sL https://multi.netlify.app/v2ray.sh) --zh
```
## 升级命令(保留配置文件更新)
```
source <(curl -sL https://multi.netlify.app/v2ray.sh) -k
```
## 卸载命令
```
source <(curl -sL https://multi.netlify.app/v2ray.sh) --remove
```
## 命令行参数
```bash
v2ray/xray [-h|help] [options]
-h, help 查看帮助
-v, version 查看版本号
start 启动 V2Ray
stop 停止 V2Ray
restart 重启 V2Ray
status 查看 V2Ray 运行状态
new 重建新的v2ray json配置文件
update 更新 V2Ray 到最新Release版本
update [version] 更新 V2Ray 到指定版本
update.sh 更新 multi-v2ray 到最新版本
add 新增端口组
add [protocol] 新增一种协议的组, 端口随机, 如 v2ray add utp 为新增utp协议
del 删除端口组
info 查看配置
port 修改端口
tls 修改tls
tfo 修改tcpFastOpen
stream 修改传输协议
cdn 走cdn
stats v2ray流量统计
iptables iptables流量统计
clean 清理日志
log 查看日志
rm 卸载core
```
## Docker运行
默认创建mkcp + 随机一种伪装头配置文件(**如果使用xray则换成镜像jrohy/xray**):
```
docker run -d --name v2ray --privileged --restart always --network host jrohy/v2ray
```
自定义v2ray配置文件:
```
docker run -d --name v2ray --privileged -v /path/config.json:/etc/v2ray/config.json --restart always --network host jrohy/v2ray
```
查看v2ray配置:
```
docker exec v2ray bash -c "v2ray info"
```
**warning**: 如果用centos,需要先关闭防火墙
```
systemctl stop firewalld.service
systemctl disable firewalld.service
```
## 建议
安装完v2ray后强烈建议开启BBR等加速: [one_click_script](https://github.com/jinwyp/one_click_script)
使用Trojan和VLESS协议建议自行安装个nginx, 能让v2ray顺利Fallback到默认的80端口
## 依赖
v2ray docker: https://hub.docker.com/r/jrohy/v2ray
xray docker: https://hub.docker.com/r/jrohy/xray
pip: https://pypi.org/project/v2ray-util/
python3: https://github.com/Jrohy/python3-install
acme: https://github.com/acmesh-official/acme.sh
Raw data
{
"_id": null,
"home_page": "https://github.com/Jrohy/multi-v2ray",
"name": "v2ray-util",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": "",
"keywords": "python v2ray multi-v2ray vmess socks5 vless trojan xray xtls reality",
"author": "Jrohy",
"author_email": "euvkzx@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7f/8a/a0087e738b9be12c2dd8dfb2976819450873db2e1f9d4dd0ccf88c0cf947/v2ray-util-3.11.4.tar.gz",
"platform": null,
"description": "# multi-v2ray\r\nV2ray/Xray\u591a\u7528\u6237\u7ba1\u7406\u811a\u672c\uff0c\u5411\u5bfc\u5f0f\u7ba1\u7406[\u65b0\u589e|\u5220\u9664|\u4fee\u6539]\u4f20\u8f93\u534f\u8bae \r\n![](https://img.shields.io/pypi/v/v2ray-util.svg) \r\n[![Downloads](https://pepy.tech/badge/v2ray-util)](https://pepy.tech/project/v2ray-util)\r\n[![Downloads](https://pepy.tech/badge/v2ray-util/month)](https://pepy.tech/project/v2ray-util)\r\n![](https://img.shields.io/docker/pulls/jrohy/v2ray.svg)\r\n![](https://img.shields.io/github/license/Jrohy/multi-v2ray.svg)\r\n\r\n## [\u4e2d\u6587](README.md) [English](README_EN.md)\r\n\r\n## \u7279\u8272\r\n- [x] \u652f\u6301Xray\u7ba1\u7406, v2ray\u548cxray\u76f8\u4e92\u72ec\u7acb, \u4e0d\u540c\u547d\u4ee4(v2ray/xray)\u8fdb\u5165\u4e0d\u540c\u7684core\u7ba1\u7406\r\n- [x] \u8c03\u7528v2ray\u5b98\u65b9api\u8fdb\u884c\u6d41\u91cf\u7edf\u8ba1\r\n- [x] **\u591a\u7528\u6237, \u591a\u7aef\u53e3\u7ba1\u7406**, \u6df7\u5408\u4f20\u8f93\u534f\u8bae\u7ba1\u7406\u4e0d\u518d\u662f\u68a6\r\n- [x] \u9996\u6b21\u5b89\u88c5\u65f6\u4ea7\u751f\u968f\u673a\u7aef\u53e3\uff0c\u9ed8\u8ba4\u914d\u7f6emkcp + \u968f\u673a\u4e00\u79cd (srtp | wechat-video | utp | dtls | wireguard) header\u4f2a\u88c5; \r\n \u00a0\u5b89\u88c5\u5b8c\u6210\u663e\u793a\u914d\u7f6e\u4fe1\u606f;\r\n- [x] \u67e5\u770b\u914d\u7f6e\u4fe1\u606f\u663e\u793avmess/vless\u5b57\u7b26\u4e32(v2rayN\u7684\u5206\u4eab\u94fe\u63a5\u683c\u5f0f)\r\n- [x] \u751f\u6210**Telegram**\u7684socks5/MTProto\u5206\u4eab\u94fe\u63a5, \u652f\u6301socks5 + tls\u7ec4\u5408\r\n- [x] \u652f\u6301http/2, \u968f\u673a\u751f\u6210\u4f2a\u88c5h2 path\r\n- [x] \u5f00\u542f\u5173\u95edtcpFastOpen\r\n- [x] \u76f4\u63a5\u5f00\u542f[CDN](https://github.com/Jrohy/multi-v2ray/wiki/CloudFlare-cdn%E4%BB%A3%E7%90%86v2ray%E6%B5%81%E9%87%8F)\r\n- [x] \u5f00\u542f\u5173\u95ed\u52a8\u6001\u7aef\u53e3\r\n- [x] \u5b9a\u65f6\u66f4\u65b0v2ray(\u9700\u624b\u52a8\u5f00\u542f)\r\n- [x] \u652f\u6301\u65b0\u7248v2ray\u914d\u7f6e\u6587\u4ef6\u683c\u5f0f(v4.1+)\r\n- [x] \u652f\u6301\u8303\u56f4\u7aef\u53e3\u4fee\u6539\r\n- [x] \u652f\u6301\u7a0b\u5e8f\u548c**\u547d\u4ee4\u884c\u53c2\u6570**\u7ba1\u7406\u63a7\u5236\r\n- [x] \u652f\u6301docker\u90e8\u7f72\r\n- [x] \u652f\u6301VLESS\u548cTrojan\u4ee5\u53caXTLS(v4.31.0+)\r\n- [x] \u652f\u6301\u7eafipv6 vps\r\n- [x] \u7981\u6b62BT\r\n\r\n## \u529f\u80fd\r\n- \u4e00\u952e \u542f\u52a8 / \u505c\u6b62 / \u91cd\u542f V2ray \u670d\u52a1\u7aef\r\n- \u6d41\u91cf\u7edf\u8ba1(v2ray && iptables)\r\n- \u547d\u4ee4\u884c\u6a21\u5f0f\u7ba1\u7406v2ray\r\n- \u652f\u6301\u591a\u7528\u6237\uff0c \u591a\u7aef\u53e3\u7ba1\u7406\r\n- \u5f00\u542f\u5173\u95ed\u52a8\u6001\u7aef\u53e3\r\n- bittorrent\u7684\u7981\u6b62\u4e0e\u653e\u884c\r\n- \u5355\u7aef\u53e3, \u8303\u56f4\u7aef\u53e3\u7684\u4fee\u6539\r\n- \u76f4\u63a5\u8d70Cloudcflare cdn\r\n- \u5f00\u542f\u5173\u95edtcpFastOpen\r\n- \u5feb\u901f\u67e5\u770b\u670d\u52a1\u5668\u8fde\u63a5\u4fe1\u606f, \u5e38\u89c4\u914d\u7f6e\u4fee\u6539\r\n- \u81ea\u7531\u66f4\u6539**\u4f20\u8f93\u914d\u7f6e**\uff1a\r\n - \u5e38\u89c4TCP\r\n - HTTP\u5934\u90e8\u4f2a\u88c5\r\n - WebSocket\u6d41\u91cf\r\n - \u5e38\u89c4mKCP\u6d41\u91cf\r\n - mKCP \u4f2a\u88c5 FaceTime\u901a\u8bdd\u6d41\u91cf(srtp)\r\n - mKCP \u4f2a\u88c5 BT\u4e0b\u8f7d\u6d41\u91cf(utp)\r\n - mKCP \u4f2a\u88c5 \u5fae\u4fe1\u89c6\u9891\u901a\u8bdd\u6d41\u91cf(wechat-video)\r\n - mKCP \u4f2a\u88c5 DTLS 1.2\u6d41\u91cf(dtls)\r\n - mKCP \u4f2a\u88c5 WireGuard\u6d41\u91cf(wireguard)\r\n - HTTP/2\u7684tls\u6d41\u91cf(h2)(\u9700\u5907\u57df\u540d) \r\n - Socks5\r\n - MTProto\r\n - Shadowsocks\r\n - Quic\r\n - VLESS_TCP\r\n - VLESS_TLS\r\n - VLESS_WS\r\n - VLESS_REALITY\r\n - Trojan\r\n\r\n## \u5b89\u88c5\u547d\u4ee4\r\n```\r\nsource <(curl -sL https://multi.netlify.app/v2ray.sh) --zh\r\n```\r\n\r\n## \u5347\u7ea7\u547d\u4ee4(\u4fdd\u7559\u914d\u7f6e\u6587\u4ef6\u66f4\u65b0)\r\n```\r\nsource <(curl -sL https://multi.netlify.app/v2ray.sh) -k\r\n```\r\n\r\n## \u5378\u8f7d\u547d\u4ee4\r\n```\r\nsource <(curl -sL https://multi.netlify.app/v2ray.sh) --remove\r\n```\r\n\r\n## \u547d\u4ee4\u884c\u53c2\u6570\r\n```bash\r\nv2ray/xray [-h|help] [options]\r\n -h, help \u67e5\u770b\u5e2e\u52a9\r\n -v, version \u67e5\u770b\u7248\u672c\u53f7\r\n start \u542f\u52a8 V2Ray\r\n stop \u505c\u6b62 V2Ray\r\n restart \u91cd\u542f V2Ray\r\n status \u67e5\u770b V2Ray \u8fd0\u884c\u72b6\u6001\r\n new \u91cd\u5efa\u65b0\u7684v2ray json\u914d\u7f6e\u6587\u4ef6\r\n update \u66f4\u65b0 V2Ray \u5230\u6700\u65b0Release\u7248\u672c\r\n update [version] \u66f4\u65b0 V2Ray \u5230\u6307\u5b9a\u7248\u672c\r\n update.sh \u66f4\u65b0 multi-v2ray \u5230\u6700\u65b0\u7248\u672c\r\n add \u65b0\u589e\u7aef\u53e3\u7ec4\r\n add [protocol] \u65b0\u589e\u4e00\u79cd\u534f\u8bae\u7684\u7ec4, \u7aef\u53e3\u968f\u673a, \u5982 v2ray add utp \u4e3a\u65b0\u589eutp\u534f\u8bae\r\n del \u5220\u9664\u7aef\u53e3\u7ec4\r\n info \u67e5\u770b\u914d\u7f6e\r\n port \u4fee\u6539\u7aef\u53e3\r\n tls \u4fee\u6539tls\r\n tfo \u4fee\u6539tcpFastOpen\r\n stream \u4fee\u6539\u4f20\u8f93\u534f\u8bae\r\n cdn \u8d70cdn\r\n stats v2ray\u6d41\u91cf\u7edf\u8ba1\r\n iptables iptables\u6d41\u91cf\u7edf\u8ba1\r\n clean \u6e05\u7406\u65e5\u5fd7\r\n log \u67e5\u770b\u65e5\u5fd7\r\n rm \u5378\u8f7dcore\r\n```\r\n\r\n## Docker\u8fd0\u884c\r\n\r\n\u9ed8\u8ba4\u521b\u5efamkcp + \u968f\u673a\u4e00\u79cd\u4f2a\u88c5\u5934\u914d\u7f6e\u6587\u4ef6(**\u5982\u679c\u4f7f\u7528xray\u5219\u6362\u6210\u955c\u50cfjrohy/xray**)\uff1a\r\n```\r\ndocker run -d --name v2ray --privileged --restart always --network host jrohy/v2ray\r\n```\r\n\r\n\u81ea\u5b9a\u4e49v2ray\u914d\u7f6e\u6587\u4ef6:\r\n```\r\ndocker run -d --name v2ray --privileged -v /path/config.json:/etc/v2ray/config.json --restart always --network host jrohy/v2ray\r\n```\r\n\r\n\u67e5\u770bv2ray\u914d\u7f6e:\r\n```\r\ndocker exec v2ray bash -c \"v2ray info\"\r\n```\r\n\r\n**warning**: \u5982\u679c\u7528centos\uff0c\u9700\u8981\u5148\u5173\u95ed\u9632\u706b\u5899\r\n```\r\nsystemctl stop firewalld.service\r\nsystemctl disable firewalld.service\r\n```\r\n\r\n## \u5efa\u8bae\r\n\u5b89\u88c5\u5b8cv2ray\u540e\u5f3a\u70c8\u5efa\u8bae\u5f00\u542fBBR\u7b49\u52a0\u901f: [one_click_script](https://github.com/jinwyp/one_click_script) \r\n\u4f7f\u7528Trojan\u548cVLESS\u534f\u8bae\u5efa\u8bae\u81ea\u884c\u5b89\u88c5\u4e2anginx, \u80fd\u8ba9v2ray\u987a\u5229Fallback\u5230\u9ed8\u8ba4\u768480\u7aef\u53e3\r\n\r\n## \u4f9d\u8d56\r\nv2ray docker: https://hub.docker.com/r/jrohy/v2ray \r\nxray docker: https://hub.docker.com/r/jrohy/xray \r\npip: https://pypi.org/project/v2ray-util/ \r\npython3: https://github.com/Jrohy/python3-install \r\nacme: https://github.com/acmesh-official/acme.sh\r\n",
"bugtrack_url": null,
"license": "GPL",
"summary": "a tool to manage v2ray config json",
"version": "3.11.4",
"project_urls": {
"Homepage": "https://github.com/Jrohy/multi-v2ray"
},
"split_keywords": [
"python",
"v2ray",
"multi-v2ray",
"vmess",
"socks5",
"vless",
"trojan",
"xray",
"xtls",
"reality"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "29441b748d1ec089b118d5486c4c642cda1a54d73309dc73d2e661421c57c152",
"md5": "49f93d085d4e00996bd01854d0d8f218",
"sha256": "02c6062aeff16d97a09486de3a288ffda693e6fd3e835b4cff74f77966f717fa"
},
"downloads": -1,
"filename": "v2ray_util-3.11.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "49f93d085d4e00996bd01854d0d8f218",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 67675,
"upload_time": "2023-07-14T08:29:55",
"upload_time_iso_8601": "2023-07-14T08:29:55.165324Z",
"url": "https://files.pythonhosted.org/packages/29/44/1b748d1ec089b118d5486c4c642cda1a54d73309dc73d2e661421c57c152/v2ray_util-3.11.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7f8aa0087e738b9be12c2dd8dfb2976819450873db2e1f9d4dd0ccf88c0cf947",
"md5": "917caac6842adeec24eb3282c754ee7b",
"sha256": "f16e69304cfb6fdba8a0bcfea5560ce377b293a3d200b67319ac362f00f03d29"
},
"downloads": -1,
"filename": "v2ray-util-3.11.4.tar.gz",
"has_sig": false,
"md5_digest": "917caac6842adeec24eb3282c754ee7b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 58096,
"upload_time": "2023-07-14T08:29:56",
"upload_time_iso_8601": "2023-07-14T08:29:56.707957Z",
"url": "https://files.pythonhosted.org/packages/7f/8a/a0087e738b9be12c2dd8dfb2976819450873db2e1f9d4dd0ccf88c0cf947/v2ray-util-3.11.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-14 08:29:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Jrohy",
"github_project": "multi-v2ray",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "v2ray-util"
}