一、下载 V2Ray

1、github.com/v2ray/v2ray-core
2、v2ray.com/download
3、github.com/v2ray/homebrew-v2ray
4、packages/community/x86_64/v2ray/
5、snapcraft.io/v2ray-core
6、Windows 客户端:
V2RayW https://github.com/Cenmrev/V2RayW
V2RayN https://github.com/2dust/v2rayN
V2RayS https://github.com/Shinlor/V2RayS
V2RayGCon https://github.com/nobody3u/V2RayGCon

二、Linux 安装脚本,更新 V2Ray 的方法是再次执行安装脚本!

简化版:
bash <(curl -L -s https://install.direct/go.sh)
复杂版:
1、下载脚本
wget https://install.direct/go.sh
2、执行脚本安装 V2Ray
sudo bash go.sh
3、修改配置文件
vi /etc/v2ray/config.json
4、启动 V2Ray
sudo systemctl start v2ray
5、停止运行 V2Ray
sudo systemctl stop v2ray
6、重启 V2Ray
sudo systemctl restart v2ray

安装目录说明:
1、/usr/bin/v2ray/v2ray:V2Ray 程序;
2、/usr/bin/v2ray/v2ctl:V2Ray 工具;
3、/etc/v2ray/config.json:配置文件;
4、/usr/bin/v2ray/geoip.dat:IP 数据文件
5、/usr/bin/v2ray/geosite.dat:域名数据文件
运行脚本位于系统的以下位置:
1、/etc/systemd/system/v2ray.service: Systemd
2、/etc/init.d/v2ray: SysV

三、脚本运行完成后:

1、编辑 /etc/v2ray/config.json 文件来配置代理方式;
2、运行 service v2ray start 来启动 V2Ray 进程;
3、之后可以使用 service v2ray start|stop|status|reload|restart|force-reload 控制 V2Ray 的运行。

四、手动安装:

go.sh 支持如下参数,可在手动安装时根据实际情况调整:
-p 或 –proxy: 使用代理服务器来下载 V2Ray 的文件,格式与 curl 接受的参数一致,比如 “socks5://127.0.0.1:1080” 或 “http://127.0.0.1:3128″。
-f 或 –force: 强制安装。在默认情况下,如果当前系统中已有最新版本的 V2Ray,go.sh 会在检测之后就退出。如果需要强制重装一遍,则需要指定该参数。
–version: 指定需要安装的版本,比如 “v1.13″。默认值为最新版本。
–local: 使用一个本地文件进行安装。如果你已经下载了某个版本的 V2Ray,则可通过这个参数指定一个文件路径来进行安装。
示例:
使用地址为 127.0.0.1:1080 的 SOCKS 代理下载并安装最新版本:./go.sh -p socks5://127.0.0.1:1080
安装本地的 v1.13 版本:./go.sh –version v1.13 –local /path/to/v2ray.zip

五、Docker部署

1、安装 Docker
sudo apt-get install -y docker
2、拉取DockerHub里的镜像
sudo docker pull v2ray/official
3、容器部署(把你的配置写好后命名为 config.json 放入 /etc/v2ray 文件夹内)
mkdir -p /etc/v2ray
sudo docker run -d –name v2ray -v /etc/v2ray:/etc/v2ray -p 8888:8888 v2ray/official v2ray -config=/etc/v2ray/config.json
4、查看容器的运行状态
sudo docker container ls
5、启动 V2Ray
sudo docker container start v2ray
6、停止 V2Ray
sudo docker container stop v2ray
7、重启 V2Ray
sudo docker container restart v2ray
8、查看日志:
sudo docker container logs v2ray
9、更新 V2Ray 的 Docker 镜像:
docker pull v2ray/official
10、更新配置后,需要重新部署容器,命令如下:
sudo docker container stop v2ray
sudo docker container rm v2ray
sudo docker run -d –name v2ray -v /etc/v2ray:/etc/v2ray -p 8888:8888 v2ray/official v2ray -config=/etc/v2ray/config.json
11、如果 V2Ray 用的传输层协议是 mKCP,由于 mKCP 基于 UDP,那么需要指定映射的端口是 UDP:
-p 9999:9999/udp
12、V2Ray 提供了两个预编译的 Docker image:
v2ray/official: 包含最新发布的版本,每周跟随新版本更新;
v2ray/dev: 包含由最新的代码编译而成的程序文件,随代码库更新。
13、两个 image 的文件结构相同:
/etc/v2ray/config.json: 配置文件
/usr/bin/v2ray/v2ray: V2Ray 主程序
/usr/bin/v2ray/v2ctl: V2Ray 辅助工具
/usr/bin/v2ray/geoip.dat: IP 数据文件
/usr/bin/v2ray/geosite:dat: 域名数据文件

六、服务器端配置文件说明:

VMess 协议的认证基于时间,一定要保证服务器和客户端的系统时间相差要在一分钟以内。修改完成后要重启 V2Ray 才会使修改的配置生效。
{
“inbound”: {
“port”: 10086, // 服务器监听端口
“protocol”: “vmess”, // 主传入协议
“settings”: {
“clients”: [
{
“id”: “b831381d-6324-4d53-ad4f-8cda48b30811” // 用户 ID,客户端与服务器必须相同
“alterId”: 64 //这个参数主要是为了加强防探测能力。理论上 alterId 越大越好,但越大就约占内存(只针对服务器,客户端不占内存)。alterId 的值设为 30 到 100 之间应该是比较合适的。alterId 的大小要保证客户端的小于等于服务器的。
}]
}
},
“outbound”: {
“protocol”: “freedom”, // 主传出协议
“settings”: {}
}
}

服务器的配置中需要确保 id 和端口与客户端一致,就可以正常连接了。

七、运行

在 Windows 和 macOS 中,配置文件通常是 V2Ray 同目录下的 config.json 文件。直接运行 v2ray 或 v2ray.exe 即可。
在 Linux 中,配置文件通常位于 /etc/v2ray/config.json 文件。运行 v2ray –config=/etc/v2ray/config.json,或使用 systemd 等工具把 V2Ray 作为服务在后台运行。

八、客户端

在你的 PC (或手机)中,你需要运行 V2Ray 并使用下面的配置:修改完成后要重启 V2Ray 才会使修改的配置生效。

{
“inbound”: {
“port”: 1080, // SOCKS 代理端口,在浏览器中需配置代理并指向这个端口
“listen”: “127.0.0.1”,
“protocol”: “socks”, // 入口协议为 SOCKS 5
“domainOverride”: [“tls”,”http”], //从网络流量中识别出域名。这个 domainOverride 有两个用处:1. 解决 DNS 污染;2. 对于 IP 流量可以应用域名路由规则
“settings”: {
“udp”: true
“auth”: “noauth” //socks的认证设置,noauth 代表不认证,由于 socks 通常在客户端使用,所以这里不认证
}
},
“outbound”: {
“protocol”: “vmess”, // 出口协议
“settings”: {
“vnext”: [{
“address”: “server”, // 服务器地址,请修改为你自己的服务器 ip 或域名
“port”: 10086, // 服务器端口
“users”: [
{
“id”: “b831381d-6324-4d53-ad4f-8cda48b30811” // 用户 ID,必须与服务器端配置相同
“alterId”: 64 // 此处的值也应当与服务器相同
}]
}]
}
},
“outboundDetour”: [{
“protocol”: “freedom”,
“tag”: “direct”,
“settings”: {}
}],
“routing”: {
“strategy”: “rules”,
“settings”: {
“domainStrategy”: “IPOnDemand”,
“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”: “direct”
}]
}
}
}

上述配置唯一要改的地方就是你的服务器 IP,配置中已注明。上述配置会把除了局域网(比如访问路由器)之外的所有流量转发到你的服务器。

TIPS:
1、检查配置文件的语法是否正确:
$ jq . config.json
这里的 config.json 是当前目录下的 config.json。特别注意命令中的点 . 不能省去。
推荐使用 V2Ray 提供的配置检查功能(test 选项)
$ /usr/bin/v2ray/v2ray -test -config /etc/v2ray/config.json

2、数据包的流向:
{浏览器} {V2Ray 客户端 inbound V2Ray 客户端 outbound} {V2Ray 服务器 inbound V2Ray 服务器 outbound} {目标网站}

3、打开客户端闪退
可能原因:客户端的配置文件上不正确。
修正方法:请仔细检查配置文件并修改正确。

4、客户端提示 Socks: unknown Socks version:
可能原因:客户端配置的 inboud 设置成了 socks 而浏览器的代理协议设置为 http。
修正方法:修改配置文件使客户端的 inboud 的 protocol 和浏览器代理设置的协议保持一致。

5、客户端提示 Proxy|HTTP: failed to read http request > malformed HTTP request “\x05\x01\x00”
可能原因:客户端配置的 inboud 设置成了 https 而浏览器的代理协议设置为 socks4 或者 socks5。
修正方法:修改配置文件使客户端的 inboud 的 protocol 和浏览器代理设置的协议保持一致。

6、服务器执行 systemctl status v2ray 输出提示 Main: failed to read config file…
可能原因:服务器的配置文件不正确。
修正方法:请仔细检查配置文件并修改正确。

7、执行 cat /var/log/v2ray/error.log 或者 systemctl status v2ray 出现 rejected Proxy|VMess|Encoding: invalid user
可能原因:服务器与客户端的系统时间或者 id 不一致或者 alterId 不一致。
修正方法:请校准系统时间或将 id 以及 alterId 修改一致。

PS:
https://v2ray.com/chapter_00/install.html
https://v2ray.com/chapter_02/protocols/vmess.html
https://v2ray.com/download/
https://v2ray.com/ui_client/
https://toutyrater.github.io/prep/install.html
https://toutyrater.github.io/basic/Shadowsocks.html
https://toutyrater.github.io/basic/log.html
https://toutyrater.github.io/advanced/dynamicport.html
https://toutyrater.github.io/app/balance.html
https://toutyrater.github.io/app/docker-deploy-v2ray.html
https://toutyrater.github.io/routing/bittorrent.html


新软师兄 » V2Ray服务器搭建
50T免费网盘资源大集合【持续更中~~~~】:点击查看

dase kand pornhan.mobi xvideo desi gay pcso 2pm result today pinoytvfriends.com where i can watch bad romeo كلام فى النيك wfporn.com قصص محارم حديثة busporn porngugu.mobi indian sexx vedios sex ka video noticieroporno.com himachal pradesh sex com
nero hentai hentaitgp.com ламия хентай www.mom xxx.com alohaporn.me sahara knite mature fucking tubepatrolporn.com bhabi sex indian girl sex gotporn.mobi xnxx family strocks ang probinsyano july 20 2022 full episode youtube pilipinoteleserye.com ano ang pambansang sasakyan ng pilipinas
احلي سكس محارم pornxporn.org نيك فلاحى multi.xnxx alohaporn.net telugu sex chart سكس قصيرات arabysexy.org نيك نقاب www assames sex com umora.info desi sexy bhabi 8teenx bukaporn.com india hot sex videos