v2ray

作者: E星期五 分类: SS-R 发布时间: 2020-03-19 12:04 ė 1661 次浏览 6 没有评论

国内的视频全是流量明星节奏大师,还是看youtube吧
安装v2ray
SSH连接上远程VPS后,下载安装脚本:
wget https://install.direct/go.sh
然后执行脚本安装V2Ray:
sudo bash go.sh
在安装完V2Ray之后,修改配置文件重启V2Ray即可,配置文件路径为/etc/v2ray/config.json

以容编辑全选覆盖
{
"log" : {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"port": 你的端口, #自动生成的端口,须与Nignx设置的相一致,可自定义
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "b25e5370-3100-4bba-b108-0367e1239efb", #自动生成的UUID
"level": 1,
"alterId": 64
}
]
},
"streamSettings": {
"network":"ws",
"wsSettings": {
"path": "/你的伪装路径", #path可自定义,这里是/ws,须与Nginx和客户端的path相一致
"headers": {
"Host": "你的域名" #Host可自定于任意域名,此处没有添加
}
}
}
},
"outbound": {
"protocol": "freedom",
"settings": {}
},
"outboundDetour": [
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"routing": {
"strategy": "rules",
"settings": {
"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": "blocked"
}
]
}
}
}

sudo service v2ray start #启动V2Ray
sudo service v2ray stop #停止运行V2Ray
sudo service v2ray restart #重启V2Ray
sudo service v2ray status #查看V2Ray状态

安装完BT,申请证书
站点「设置」的「配置文件」选项,在ssl最后一个}前添加如下代码:
location /ws {
proxy_pass http://127.0.0.1:123;
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;
}

重启「Nignx服务」

service v2ray restart #重启V2Ray服务
service v2ray status #查看v2ray是否运行

最新版:ERROR: This script has been DISCARDED, please switch to fhs-install-v2ray project.
HOW TO USE: https://github.com/v2fly/fhs-install-v2ray
TO MIGRATE: https://github.com/v2fly/fhs-install-v2ray/wiki/Migrate-from-the-old-script-to-this

停止V2Ray服务
[cc]# systemctl disable v2ray.service –now[/cc]
可移除的原始文件
[cc]# rm -r /usr/bin/v2ray/
# rm /etc/systemd/system/v2ray.service
# rm /lib/systemd/system/v2ray.service
# rm /etc/init.d/v2ray[/cc]
迁移配置文档
[cc]# mv /etc/v2ray/ /usr/local/etc/[/cc]
修改 Log 權限
nobody:nogroup
[cc]$ id nobody[/cc]

uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
[cc]# chown -R nobody:nogroup /var/log/v2ray/[/cc]
nobody:nobody
[cc]$ id nobody[/cc]

uid=65534(nobody) gid=65534(nobody) groups=65534(nobody)
[cc]# chown -R nobody:nobody /var/log/v2ray/[/cc]
下載此指令碼
[cc]$ curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh[/cc]
執行此指令碼
[cc]# bash install-release.sh[/cc]

下载
// 安装本体和数据文件
[cc]# curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh[/cc]
// 只更新数据文件
[cc]# curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh[/cc]
安装和更新V2Ray

[cc]# bash install-release.sh[/cc]

启动
[cc]systemctl enable v2ray[/cc]
[cc]systemctl start v2ray[/cc]
查看状态
[cc]service v2ray status[/cc]

本文出自E星期五的博客,转载时请注明出处及相应链接。

本文永久链接: https://exqw.com/archives/999.html

0

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

Ɣ回顶部