V2ray丨新VLESS协议配置
其他不说了,搜一搜都应该知道个大概,我也是最近才反应过来,重新改为了VLESS。之前的vmess也不是不能用,就是不安全,容易被发现然后被封(从漏洞发现半年过去了啥事也没有)。
前面的服务器和安装宝塔就不说了。
BBR加速
#bbr 4 in 1 脚本 wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
安脚本列表选择运行即可。
建立网站
通过宝塔建立个新网站,并且把域名指定到服务器IP,然后开启HTTPS认证,在配置文件中的 #SSL-END 后面添加
location /cs
{
proxy_pass http://127.0.0.1:你的端口号;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_read_timeout 300s;
}修改你的端口号,并且在宝塔安全里放行该端口。
安装V2ray
安装依赖组件cURL,通过ssh连接服务器运行代码。
yum makecache yum install curl
下载脚本
curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh
安装和更新V2ray
bash install-release.sh
bash install-dat-release.sh
在宝塔的文件里的根目录找到 /usr/local/etc/v2ray/ 下的config文件,全部替换为
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbounds": [
{
"port":你的端口,
"listen": "127.0.0.1",
"tag": "VLESS-in",
"protocol": "VLESS",
"settings": {
"clients": [
{
"id":"你的 UUID",
"alterId": 0
}
],
"decryption": "none"
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path":"/cs"
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": { },
"tag": "direct"
},
{
"protocol": "blackhole",
"settings": { },
"tag": "blocked"
}
],
"dns": {
"servers": [
"https+local://1.1.1.1/dns-query",
"1.1.1.1",
"1.0.0.1",
"8.8.8.8",
"8.8.4.4",
"localhost"
]
},
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"inboundTag": [
"VLESS-in"
],
"outboundTag": "direct"
}
]
}
}uuid可通过在线生成。
开机启动运行V2ray
ssh里运行
systemctl enable v2ray systemctl start v2ray
可能需要重启Nginx和服务器。
客户端
Windows端:V2rayN(v3.29)
安卓端:V2rayNG(1.4.13)
提前更新到最新版本,否则可能不支持VLESS。

内容配置基本一致,注意是添加VLESS服务器。
注:之后可能会有不兼容更新,请考虑清楚后再设置更新。


