v2ray安装使用

前置准备

  • 一台vps机器,有外网ip
  • 一个域名可配置即可

v2ray安装脚本

1
bash <(curl -s -L https://git.io/v2ray.sh)

选择4使用ws+tls配置方式,端口与任意即可
域名使用自己一个子域名即可,例如:tizi.lephee.net

完成后有vmess的url,可以直接复制到客户端使用

以后忘记可以在服务器输入v2ray url显示

安装BBR Plus

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 升级内核安装
wget "https://github.com/cx9208/bbrplus/raw/master/ok_bbrplus_centos.sh" && chmod +x ok_bbrplus_centos.sh && ./ok_bbrplus_centos.sh

# 使用该脚本切换到bbr_plus以及配置优化
wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && ./tcp.sh

# 查看状态
lsmod | grep bbr

# 查看当前已经使用的TCP拥塞控制配置
cat /proc/sys/net/ipv4/tcp_congestion_control

# 查看当前配置
cat /etc/sysctl.conf

如果未开启则执行

1
sudo modprobe tcp_bbrplus

cloudflare转发配置(cdn方式)自测不如下方workers方式速度快

  1. 在cloudflare配置你的域名,根据提示在域名商处配置cf的nameserver
  2. 验证通过后,在记录配置中添加上方v2ray使用的域名tizi.lephee.net
  3. SSL/TLS页签中,将SSL/TLS encryption mode改成full

客户端配置中直接使用相同域名即可,会自动走cloudflare的cdn加速

cloudflare workers转发加速

  1. 在cloudflare中选择workers,添加新的workers
  2. 脚本代码输入下方,这里注意域名输入上方v2ray使用的域名tizi.lephee.net
1
2
3
4
5
6
7
8
9
10
addEventListener(
"fetch",event => {
let url=new URL(event.request.url);
url.hostname="tizi.lephee.net";
let request=new Request(url,event.request);
event. respondWith(
fetch(request)
)
}
)
  1. 部署完成

客户端配置中需要要使用worker分配的域名,才会经过cf的worker加速

作者

LePhee

发布于

2020-09-25

更新于

2020-09-25

许可协议

评论