2020.12.05更新:最新版V2ray-core已经移除了XTLS,如果你要使用XTLS技术,推荐用 Xray一键脚本
今天抽空把支持V2ray最新VLESS协议一键脚本弄完了。本次的V2ray一键脚本功能强大,支持常规VMESS协议、VMESS+websocket+TLS+Nginx、VLESS+TCP+XTLS、VLESS+TCP+TLS等多种组合,支持CentOS 7/8、Ubuntu 16.04以上、Debian 8以上系统,以及相关衍生系统。
注意:目前CentOS7系统已经到生命周期,不建议使用该系统,可能会导致脚本运行失败!建议使用Debian或者Ubuntu系统。
V2ray VLESS+TCP+XTLS一键脚本
本V2ray一键脚本使用步骤如下:
1. 准备一个境外服务器,想服务器速度快请参考 搬瓦工VPS购买教程 或从 CN2 GIA VPS商家推荐 选购,想ip被封后免费换请参考:购买vultr服务器超详细图文教程。
如果用VMESS+WS+TLS或者VLESS系列协议,则还需一个域名。对域名没有要求,国内/国外注册的都可以,不需要备案,不会影响使用,也不会带来安全/隐私上的问题。购买域名可参考:Namesilo购买域名详细教程。
值得一提的是本V2ray一键脚本支持ipv6 only服务器,但是不建议用只有ipv6的VPS用来科学上网。
2. 如果vps运营商开启了防火墙(阿里云、Ucloud、腾讯云、AWS、GCP等商家默认有,搬瓦工/hostdare/vultr等商家默认关闭),请先登录vps管理后台放行80和443端口,否则可能会导致获取证书失败。此外,本脚本支持上传自定义证书,可跳过申请证书这一步,也可用在NAT VPS上。
3. ssh连接到服务器。Windows系统请参考 Bitvise连接Linux服务器教程,mac用户请参考 Mac电脑连接Linux教程。
4. 复制(或手动输入)下面命令到终端:
bash <(curl -sL https://raw.githubusercontent.com/daveleung/hijkpw-scripts-mod/main/xray_mod1.sh)
按回车键,将出现如下操作菜单。如果菜单没出现,CentOS系统请输入 yum install -y curl
,Ubuntu/Debian系统请输入 apt install -y curl
,然后再次运行上面的命令:
目前V2ray一键脚本支持以下功能:
- VMESS,即最普通的V2ray服务器,没有伪装,也不是VLESS
- VMESS+KCP,传输协议使用mKCP,VPS线路不好时可能有奇效
- VMESS+TCP+TLS,带伪装的V2ray,不能过CDN中转
- VMESS+WS+TLS,即最通用的V2ray伪装方式,能过CDN中转,推荐使用
- VLESS+KCP,传输协议使用mKCP
- VLESS+TCP+TLS,通用的VLESS版本,不能过CDN中转,但比VMESS+TCP+TLS方式性能更好
- VLESS+WS+TLS,基于websocket的V2ray伪装VLESS版本,能过CDN中转,有过CDN情况下推荐使用
- VLESS+TCP+XTLS,目前最强悍的VLESS+XTLS组合,强力推荐使用(但是支持的客户端少一些)
- trojan,轻量级的伪装协议
- trojan+XTLS,trojan加强版,使用XTLS技术提升性能
注意:目前一些客户端不支持VLESS协议,或者不支持XTLS,请按照自己的情况选择组合
5. 按照自己的需求选择一个方式。例如6,然后回车。接着脚本会让你输入一些信息,也可以直接按回车使用默认值。需要注意的是,对于要输入伪装域名的情况,如果服务器上有网站在运行,请联系运维再执行脚本,否则可能导致原来网站无法访问!
6. 脚本接下来会自动运行,一切顺利的话结束后会输出配置信息:
注意,脚本不适用最新版,原因是脚本在安装v2ray过程中,第822行默认从(https://github.com/v2fly/v2ray-core/releases/)抓取最新版本。解压后cp到对应位置,目前的最新版本为v5.1.0。该版本解压后,没有v2ctl文件,copy失败后,导致脚本意外终止,请作者予以修正。
脚本未修正前的临时解决方法:
wget https://raw.githubusercontent.com/daveleung/hijkpw-scripts-mod/main/v2ray_mod1.sh
chmod a+x v2ray_mod1.sh
vi v2ray_mod1.sh
(将822行中的${NEW_VER}修改为v4.45.2)
./v2ray_mod1.sh
到此服务端配置完毕,服务器可能会自动重启(没提示重启则不需要),windows终端出现“disconnected”,mac出现“closed by remote host”说明服务器成功重启了。
对于VLESS协议、VMESS+WS+TLS的组合,网页上输入伪装域名,能正常打开伪装站,说明服务端已经正确配置好。如果运行过程中出现问题,请在本页面下方查找解决方法或留言。
V2ray一键脚本注意事项
服务端配置好后,如果想使用CloudFlare等CDN中转(必须是WS版才可以),请参考:使用cloudflare中转流量,拯救被墙ip。
本脚本默认使用的加速技术是BBR,换成魔改BBR/BBR Plus/锐速清参考:安装魔改BBR/BBR Plus/锐速(Lotserver)。
如果伪装站类型没有你满意的,比如你想搭建WordPress博客,请参考:V2ray伪装建站教程。
对于使用TLS的方式,脚本默认会申请域名证书,证书存放在和V2ray配置文件同一个文件夹内(即/etc/v2ray
目录下)。证书会自动更新,如果客户端突然无法使用,请打开伪装网站查看是否能正常打开。如果证书已过期,请再次运行上面的脚本重新配置。
最后,刚搭建好V2ray后不要猛上流量,否则会导致被限速、端口被墙,严重可能导致ip被墙。
接下来是配置客户端,下载客户端和配置教程请参考:
祝大家使用愉快。如有问题请在页面下方留言。
大佬,VLESS+TCP+XTLS安装、运行成功,centos7防火墙已关闭,oracle cloud 安全组入站端口已全部放开。
安卓v2rayNG连接时提示:context deadline exceeded。
v2ray日志提示:
[Warning] [3012128909] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/vless/inbound: failed to find the default “alpn” config。
请大佬解惑!
更换xray内核
您好 请问 为何明明nslookup我的域名已经是vps的ip地址了 但还是显示出来我的域名 尚未解析到vps上啊?
还没有同步,再等等
你好
请问了解过内网穿透吗?
能不能和Nps内网穿透共存?
Nps占用80和443,这个伪装也占用80和443,怎么在不改变Nps端口的情况下共存
需要自己编辑nginx配置文件
[Mon Sep 13 22:14:00 CST 2021] Create new order error. Le_OrderFinalize not found. {
“type”: “urn:ietf:params:acme:error:rejectedIdentifier”,
“detail”: “Error creating new order :: Cannot issue for \”202.182.111.132\”: The ACME server can not issue a certificate for an IP address”,
“status”: 400
}
[Mon Sep 13 22:14:00 CST 2021] Please add ‘–debug’ or ‘–log’ to check more details.
[Mon Sep 13 22:14:00 CST 2021] See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh
[Mon Sep 13 22:14:00 CST 2021] Run post hook:’systemctl restart nginx’
获取证书失败,请复制上面的红色文字到 https://hijk.art 反馈
输入域名
你好兄弟
我安装的 macku的 v2ray script 然后有的网站我上之后晕倒这个问题
2021/09/30 17:45:10 [Warning] [448070694] app/proxyman/outbound: failed to process outbound traffic > proxy/vless/outbound: failed to find an available destination > common/retry: [dial tcp xxx:443: operation was canceled dial tcp: operation was canceled] > common/retry: all retry attempts failed
2021/09/30 17:45:10 [Warning] [2287171543] app/proxyman/outbound: failed to process outbound traffic > proxy/vless/outbound: failed to find an available destination > common/retry: [dial tcp xxx: operation was canceled dial tcp: operation was canceled] > common/retry: all retry attempts failed
2021/09/30 17:45:10 [Warning] [129394649] app/proxyman/outbound: failed to process outbound traffic > proxy/vless/outbound: failed to find an available destination > common/retry: [dial tcp xxx: operation was canceled dial tcp: operation was canceled] > common/retry: all retry attempts failed
不是每一个网站有这个问题?
多谢
可能那个网站挂了
google.com is down, thanks idiot
博主你好,打扰你一会,新换了个namesilo域名,也解析成功了,运行脚本的时候会出现这个
Changed default CA to: https://acme-v02.api.letsencrypt.org/directory
[Sun Oct 10 00:56:24 EDT 2021]
Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 60请问该怎么解决呢?
换个系统
好的,谢谢
刚刚换了centos 7*86运行脚本还是显示这个
Changed default CA to: https://acme-v02.api.letsencrypt.org/directory
[Sun Oct 10 01:05:16 EDT 2021] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 60
[Sun Oct 10 01:05:18 EDT 2021] Can not init api for: https://acme-v02.api.letsencrypt.org/directory.
应该是服务器网络问题
那现在是转个别的地区的服务器吗?还是有其他解决方法呢
Can not init api for: https://acme-v02.api.letsencrypt.org/directory.
[Sun Oct 10 01:09:22 EDT 2021] Sleep 10 and retry.
[Sun Oct 10 01:09:51 EDT 2021] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 60
[Sun Oct 10 01:09:53 EDT 2021] Can not init api for: https://acme-v02.api.letsencrypt.org/directory.
[Sun Oct 10 01:09:53 EDT 2021] Sleep 10 and retry.
[Sun Oct 10 01:10:04 EDT 2021] Can not init api, for https://acme-v02.api.letsencrypt.org/directory
获取证书失败,请复制上面的红色文字到 https://hijk.art 反馈
重试完显示这个了
换个别的地区服务器
换了个纽约的服务器,还是一样的情况
Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 60
[Sun Oct 10 02:05:51 EDT 2021] Can not init api for: https://acme-v02.api.letsencrypt.org/directory.
估计是证书服务器问题,过几个小时再试试吧
好的,谢谢博主!我晚点再试试
朋友,我和你遇到了同样的问题,请问最后解决了吗
我也是这个问题,你解决了么?
龙哥,我用的是VLESS+TCP+XTLS,使用三个月正常,今天突然出问题:ios上用shadowrocket正常访问,windows上用v2rayN也是可以ping通,但是无法使用,客户端提示如下,请教一下什么问题
2021/10/31 14:25:22 [Warning] [2940436467] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vless/outbound: connection ends > v2ray.com/core/proxy/vless/outbound: failed to decode response header > v2ray.com/core/proxy/vless/encoding: failed to read response version > x509: certificate has expired or is not yet valid:
证书过期了,重新运行一键脚本
卸载v2ray重新卸载脚本的时候出现下面这个问题咋整😢,端口换了也是这样
[Sun Oct 31 08:40:11 EDT 2021] OK
[Sun Oct 31 08:40:11 EDT 2021] Install success!
[Sun Oct 31 08:40:12 EDT 2021] Already uptodate!
[Sun Oct 31 08:40:12 EDT 2021] Upgrade success!
[Sun Oct 31 08:40:12 EDT 2021] Changed default CA to: https://acme-v02.api.letsencrypt.org/directory
[Sun Oct 31 08:40:29 EDT 2021] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 60
[Sun Oct 31 08:40:31 EDT 2021] Can not init api for: https://acme-v02.api.letsencrypt.org/directory.
[Sun Oct 31 08:40:31 EDT 2021] Sleep 10 and retry.
[Sun Oct 31 08:41:00 EDT 2021] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 60
[Sun Oct 31 08:41:02 EDT 2021] Can not init api for: https://acme-v02.api.letsencrypt.org/directory.
[Sun Oct 31 08:41:02 EDT 2021] Sleep 10 and retry.
[Sun Oct 31 08:41:31 EDT 2021] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 60
[Sun Oct 31 08:41:33 EDT 2021] Can not init api for: https://acme-v02.api.letsencrypt.org/directory.
[Sun Oct 31 08:41:33 EDT 2021] Sleep 10 and retry.
建议换个系统
谢谢哥,我试试
大佬,请问下搬瓦工centos7系统,v2ray域名证书到期,按教程操作续期的时候提示[Tue Nov 2 14:29:43 CST 2021] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 60
[Tue Nov 2 14:29:45 CST 2021] Can not init api for: https://acme-v02.api.letsencrypt.org/directory.
是什么问题?
许多人反馈搬瓦工的有这个问题,建议换debian或者ubuntu试试
我把centos7重装成centos8再运行脚本就成了
您好,多次出现获取证书失败问题,请问怎么解决,谢谢!
[Tue Nov 9 10:12:23 CST 2021] Installing from online archive.
[Tue Nov 9 10:12:23 CST 2021] Downloading https://github.com/acmesh-official/acme.sh/archive/master.tar.gz
[Tue Nov 9 10:12:24 CST 2021] Extracting master.tar.gz
[Tue Nov 9 10:12:24 CST 2021] Installing to /usr/local/acme.sh
[Tue Nov 9 10:12:24 CST 2021] Installed to /usr/local/acme.sh/acme.sh
[Tue Nov 9 10:12:24 CST 2021] Installing alias to ‘/root/.bashrc’
[Tue Nov 9 10:12:24 CST 2021] OK, Close and reopen your terminal to start using acme.sh
[Tue Nov 9 10:12:24 CST 2021] Installing cron job
39 0 * * * “/usr/local/acme.sh”/acme.sh –cron –home “/usr/local/acme.sh” > /dev/null
[Tue Nov 9 10:12:24 CST 2021] Good, bash is found, so change the shebang to use bash as preferred.
[Tue Nov 9 10:12:24 CST 2021] OK
[Tue Nov 9 10:12:24 CST 2021] Install success!
/dev/fd/63: line 547: /root/.acme.sh/acme.sh: No such file or directory
/dev/fd/63: line 548: /root/.acme.sh/acme.sh: No such file or directory
/dev/fd/63: line 552: /root/.acme.sh/acme.sh: No such file or directory
获取证书失败,请复制上面的红色文字到 https://hijk.art 反馈
换个系统
安装nginx…
您安装了宝塔,请在宝塔后台安装nginx后再运行本脚本
说明安装了宝塔,在宝塔里安装或者重装系统
博主你好,我VMESS用的一直很流畅,这几天突然就只能断断续续的用,多数情况下都连不上,可以帮忙看一下吗一直弹这个
2021/11/12 03:17:27 [Warning] [3119963288] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [dial tcp 45.77.106.94:60003: i/o timeout dial tcp 45.77.106.94:60003: operation was canceled] > v2ray.com/core/common/retry: all retry attempts failed
端口被墙了
能快速进入脚本吗,比如执行v2ray就会出现脚本
不支持
好吧
即使是用脚本也花了我好几个小时研究。谢谢分享,非常好用。
我花了两天 然后443和80端口打不开
可能是端口被墙了,换一个
多用户的话修改哪里
自行编辑配置文件
请问显示daemons using outdated libraries怎么办
升级系统
你好,
我在创建的时候显示下面问题,请问要怎样解决?
[Wed 24 Nov 2021 10:41:37 AM CST] Verifying: adffq.xyz
[Wed 24 Nov 2021 10:41:37 AM CST] Standalone mode server
[Wed 24 Nov 2021 10:41:39 AM CST] Pending, The CA is processing your order, please just wait. (1/30)
[Wed 24 Nov 2021 10:41:42 AM CST] Pending, The CA is processing your order, please just wait. (2/30)
[Wed 24 Nov 2021 10:41:45 AM CST] Pending, The CA is processing your order, please just wait. (3/30)
[Wed 24 Nov 2021 10:41:47 AM CST] Pending, The CA is processing your order, please just wait. (4/30)
[Wed 24 Nov 2021 10:41:50 AM CST] adffq.xyz:Verify error:During secondary validation: Invalid response from http://adffq.xyz/.well-known/acme-challenge/eofxhfI2w-5l_cjL_aYOGs4wNe7U60SWOmfVovIJzrs [34.102.136.180]:
[Wed 24 Nov 2021 10:41:50 AM CST] Please add ‘–debug’ or ‘–log’ to check more details.
[Wed 24 Nov 2021 10:41:50 AM CST] See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh
[Wed 24 Nov 2021 10:41:50 AM CST] Run post hook:’systemctl restart nginx’
获取证书失败,请复制上面的红色文字到 https://hijk.art 反馈
dns没生效或者解析错了
卡在这步无限循环怎么办
[Sun Nov 28 22:08:06 EST 2021] Changed default CA to: https://acme-v02.api.letsencrypt.org/directory
[Sun Nov 28 22:08:23 EST 2021] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 60
[Sun Nov 28 22:08:25 EST 2021] Can not init api for: https://acme-v02.api.letsencrypt.org/directory.
[Sun Nov 28 22:08:25 EST 2021] Sleep 10 and retry.
0
升级系统到最新版或者换个系统
更换服务器系统吗?
是的
我用的是VMESS+WS+TLS,VPS重启后获提示,V2RAY启动了,但反代没启动,要在菜单里手动启动V2RAY后,服务才可用
应该是服务器开机的时候没解析出反代网站的ip
脚本默认的acme的证书用不了了,大佬能否解决一下,感激不尽