v2ray游戏攻略
Buzzing

v2ray 的安装与配置

使用 v2ray + Websocket + TLS

Web 服务器使用 Nginx


使用的 v2ray 版本:https://github.com/v2fly

使用的安装脚本:https://github.com/v2fly/fhs-install-v2ray

白话文教程:https://toutyrater.github.io/


下载安装脚本:

1
2
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

1
bash install-release.sh

安装和更新 geoip.datgeosite.dat

1
bash install-dat-release.sh

生成 uuid

1
cat /proc/sys/kernel/random/uuid

配置 /usr/local/etc/v2ray/config.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
"inbounds": [
{
"port": PORT, // 填入端口号
"listen": "127.0.0.1",
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "UUID", // 填入UUID
"alterId": 64
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/PATH" // 填入PATH
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}

移除 v2ray

1
bash install-release.sh --remove

启动 v2ray

1
2
3
service v2ray start
# 常用命令
service v2ray start|stop|status|reload|restart|force-reload

常用参数

1
2
3
4
5
6
7
8
9
usage: install-release.sh [--remove | --version number | -c | -f | -h | -l | -p]
[-p address] [--version number | -c | -f]
--remove Remove V2Ray
--version Install the specified version of V2Ray, e.g., --version v4.18.0
-c, --check Check if V2Ray can be updated
-f, --force Force installation of the latest version of V2Ray
-h, --help Show help
-l, --local Install V2Ray from a local file
-p, --proxy Download through a proxy server, e.g., -p http://127.0.0.1:8118 or -p socks5://127.0.0.1:1080

一键脚本解决方案:https://github.com/233boy/v2ray


反向代理的配置

你可以使用 web 服务器软件配置反向代理,包括但不局限于 NginxCaddyApache

这里以 Nginx 举例,反向代理部分的配置如下

1
2
3
4
5
6
7
8
9
10
11
12
location /PATH		# 填入PATH
{
proxy_pass http://127.0.0.1:PORT; # 填入端口号
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_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

完整的配置可以参考 Nginx wiki


教程参考:https://toutyrater.github.io/advanced/wss_and_web.html

由 Hexo 驱动 & 主题 Keep
本站由 提供部署服务