UCloud全球大促:https://www.ucloud.cn/site/active/kuaijiesale.html?invitation_code=C1x2E6088EA03C6
CDN超值特惠专场:https://www.ucloud.cn/site/active/cdn-ufile.html?invitation_code=C1x2E6088EA03C6
快杰云主机推广:https://www.ucloud.cn/site/active/ohost.html?invitation_code=C1x2E6088EA03C6
安装wget
sudo yum -y install wget
安装unzip
sudo yum install zip unzip
安装v2ray
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)
项目地址
安装和更新文档
参考网站
cat /proc/sys/kernel/random/uuid
b72dc422-5813-4a98-98fc-e14c3e9904d8
进入config.json
/usr/local/etc/v2ray/config.json
配置如下
{
"inbounds": [{
"port": 20001,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "b72dc422-5813-4a98-98fc-e14c3e9904d8",
"level": 1,
"alterId": 64
}
]
}
}],
"outbounds": [{
"protocol": "freedom",
"settings": {}
},{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}],
"routing": {
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "blocked"
}
]
}
}
直接复制我上面的配置即可使用,id就是上面第二步获取的用户id
此时端口是20001
ID是b72dc422-5813-4a98-98fc-e14c3e9904d8
在首次安装完成之后,V2Ray 不会自动启动,需要手动运行上述启动命令
## 启动
sudo systemctl start v2ray
## 停止
sudo systemctl stop v2ray
## 重启
sudo systemctl restart v2ray
图形客户端
V2RayW
V2RayN
Clash for Windows
V2RayX
V2RayU
V2RayC
ClashX
Qv2ray
Mellow
Kitsunebi
i2Ray
下载:iTunes
Shadowrocket
Pepi(原名ShadowRay)
Quantumult
BifrostV
V2RayNG
VeekXT V2Ray配置生成
V2Ray 配置生成器
UUID Generator
vTemplate 项目仓库
v2ray服务器配置
{
"inbounds": [
{
"port": 20001,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "b72dc422-5813-4a98-98fc-e14c3e9904d8",
"alterId": 0,
"email": ""
}
],
"decryption": "none"
},
"streamSettings": {
"network": "ws",
"security": "none",
"tlsSettings": {},
"wsSettings": {
"connectionReuse": true,
"path": "/blog",
"headers": {
"Host": "你的域名(需要配置到自己的网站上去)"
}
}
},
"tag": "proxy"
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIP"
}
},
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"routing": {
"settings": {
"rules": [
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
},
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"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"
}
]
},
"strategy": "rules"
}
}
客户端配置
nginx配置中添加如下配置(拦截的相关后缀根据上边的配置自行修改)
location /blog
{
proxy_redirect off;
proxy_pass http://127.0.0.1:20001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
我使用了https协议进行伪装,自己根据自己的需求进行修改,BT面板可以直接自己进行修改