v2ray带伪装一键脚本

2020.10.26更新:推荐使用 V2ray多合一脚本,支持VMESS+websocket+TLS+Nginx、VLESS+TCP+XTLS、VLESS+TCP+TLS等组合

今天抽空完成了CentOS系统的v2ray带伪装一键安装脚本,代码已上传到 Github。本脚本能让您在服务端一键安装基于Nginx+websocket+tls的v2ray流量伪装和bbr加速模块,接下来就感受稳如狗的体验吧,再也不用担心ip被墙了!

Ubuntu系统请参考:v2ray带伪装一键脚本Ubuntu版

V2ray带伪装一键脚本使用教程

1. 准备一个境外服务器,想服务器速度快请参考 搬瓦工VPS购买教程 或从  CN2 GIA VPS商家推荐 选购,想ip被封后免费换请参考:购买vultr服务器超详细图文教程

伪装的前提是需要一个域名(例如hijk.art),并且域名的某个主机名(例如www.hijk.art)正确解析到服务器的ip。对域名没有要求,国内/国外注册的都可以,不需要备案,不会影响使用,也不会带来安全/隐私上的问题。购买域名可参考:Namesilo购买域名详细教程。不想购买请使用常规版的一键脚本:v2ray一键脚本

值得一提的是本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. 复制(或手动输入)下面命令到终端

yum install -y curl
bash <(curl -sL https://raw.githubusercontent.com/hiifeng/v2ray/main/install_v2ray.sh) 

按回车键,脚本开始询问你一些信息,请按照提示输入,其中一些问题可直接按回车使用默认值。

注意,脚本不适用最新版,原因是脚本在安装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”或”broken pipe”),请重新连接后再次执行命令。脚本运行成功会输出配置信息,截图如下:

带伪装v2ray配置

带伪装v2ray配置

到此服务端配置完毕,服务器可能会自动重启(没提示重启则不需要),windows终端出现“disconnected”,mac出现“closed by remote host”说明服务器成功重启了。

打开浏览器输入伪装域名,能正常打开伪装站,说明服务端在正常运行;输入域名加伪装路径,出现”bad request”,则说明服务端已经完全没问题。

V2ray带伪装一键脚本其他事项

1. 查看v2ray运行状态 / 配置:bash <(curl -sL https://raw.githubusercontent.com/luciferkids/hijkpw-scripts/main/centos_install_v2ray2.sh) info

2. v2ray管理命令:启动:systemctl start v2ray,停止:systemctl stop v2ray,重启:systemctl restart v2ray

3. nginx管理命令:测试配置文件有无错误:nginx -t,启动:systemctl start nginx,停止:systemct stop nginx,重启:systemctl restart nginx

4. 更新v2ray到最新版:bash <(curl -sL https://raw.githubusercontent.com/luciferkids/hijkpw-scripts/main/goV2.sh)(提示“装不上daemon”不用管,systemctl restart v2ray重新启动v2ray就好了)

5. 伪装网站SSL证书放在配置文件的文件夹下,会自动续期;

6. 卸载: bash <(curl -sL https://raw.githubusercontent.com/luciferkids/hijkpw-scripts/main/centos_install_v2ray2.sh) uninstall

7. 建站/改伪装网站请参考:v2ray伪装建站教程

8. 搭建TG代理请参考: 一键搭建Telegram的MTProto代理

9. 希望上cdn,请根据本教程操作完后再阅读:v2ray使用cloudflare中转流量,拯救被墙ip

10. 理论上只要流量够、服务器扛得住,同一个配置支持无数人、无限设备使用。如果想为不同的人配置不同的id,请参考:v2ray多用户配置

12. 脚本默认使用BBR技术加速, BBR换成魔改BBR/BBR Plus/锐速清参考:安装魔改BBR/BBR Plus/锐速(Lotserver)

13. 搭建好伪装v2ray后建站/改伪装网站请参考:v2ray伪装建站教程

14. 刚搭建好带伪装的v2ray不要猛上流量,否则可能导致被限速、端口被墙,严重可能ip被墙。

V2ray客户端下载

接下来是科学上网最后一步:下载客户端,并参考页面中的配置教程进行配置:

v2ray windows客户端下载

v2ray安卓客户端下载

v2ray mac客户端下载

v2ray ios客户端下载

下载客户端配置好后,就可以愉快的上外网了!

参考

1.V2ray教程

2. v2ray高级技巧:流量伪装

3. trojan一键脚本

《v2ray带伪装一键脚本》上有271条评论

  1. 最近是啥情况,3天内就被这样,已经换了好多port了。。。。

    app/proxyman/outbound: failed to process outbound traffic > proxy/vmess/outbound: failed to find an available destination > common/retry: [transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to

      1. 老大,麻烦看一下哪里有问题
        — Logs begin at Mon 2023-03-27 02:05:33 CST, end at Mon 2023-04-17 09:33:10 CST. —
        Apr 17 09:17:58 classic-pods-1.localdomain systemd[1]: Started V2ray Service.
        — Subject: Unit v2ray.service has finished start-up
        — Defined-By: systemd
        — Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

        — Unit v2ray.service has finished starting up.

        — The start-up result is done.
        Apr 17 09:17:58 classic-pods-1.localdomain v2ray[19259]: V2Ray 5.4.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.20.2 linux/amd64)
        Apr 17 09:17:58 classic-pods-1.localdomain v2ray[19259]: A unified platform for anti-censorship.
        Apr 17 09:17:58 classic-pods-1.localdomain v2ray[19259]: 2023/04/17 09:17:58 [Warning] V2Ray 5.4.1 started
        Apr 17 09:18:15 classic-pods-1.localdomain systemd[1]: Stopping V2ray Service…
        — Subject: Unit v2ray.service has begun shutting down
        — Defined-By: systemd
        — Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

        — Unit v2ray.service has begun shutting down.
        Apr 17 09:18:15 classic-pods-1.localdomain systemd[1]: Stopped V2ray Service.
        — Subject: Unit v2ray.service has finished shutting down
        — Defined-By: systemd
        — Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

        — Unit v2ray.service has finished shutting down.
        Apr 17 09:20:47 classic-pods-1.localdomain systemd[1]: Started V2ray Service.
        — Subject: Unit v2ray.service has finished start-up
        — Defined-By: systemd
        — Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

        — Unit v2ray.service has finished starting up.

        — The start-up result is done.
        Apr 17 09:20:47 classic-pods-1.localdomain v2ray[21236]: V2Ray 5.4.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.20.2 linux/amd64)
        Apr 17 09:20:47 classic-pods-1.localdomain v2ray[21236]: A unified platform for anti-censorship.
        Apr 17 09:20:47 classic-pods-1.localdomain v2ray[21236]: 2023/04/17 09:20:47 [Warning] V2Ray 5.4.1 started

  2. 安装V2ray…
    /dev/fd/63: line 201: /usr/bin/v2ray/v2ray: No such file or directory
    安装V2Ray v5.7.0 ,架构64
    下载V2Ray: https://github.com/v2fly/v2ray-core/releases/download/v5.7.0/v2ray-linux-64.zip
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 –:–:– 0:02:09 –:–:– 0
    curl: (28) Failed to connect to github.com port 443: Connection timed out
    下载V2ray文件失败,请检查服务器网络设置

    __________________________________________________________分割线
    我云服务器一直不能从github下载v2ray,还有acme.sh,都是显示443: Connection timed out 或者 Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 28 或者是 中国大陆用户请参考:
    https://github.com/acmesh-official/acme.sh/wiki/Install-in-China

    我明明是外网东南亚地方的vps服务器呀,lightnode云服务商的服务器。

      1. 会不会是lightnode服务器商的问题?我之前用vultr的服务器,搭建美国和日本的额一下子就脚本搭建好了。
        而lightnode服务器搭建东南亚节点时,脚本总是不能下载安装上,而且这个服务器很奇怪有公网和内网区分,但我ssh似乎连上的就是这个服务器,但我依然想不明白是什么问题。

      2. –2023-06-16 03:43:44– https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/v2ray.sh
        Resolving raw.githubusercontent.com (raw.githubusercontent.com)… 185.199.108.133, 185.199.111.133, 185.199.110.133, …
        Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443… connected.
        HTTP request sent, awaiting response… 200 OK
        Length: 21729 (21K) [text/plain]
        Saving to: ‘v2ray.sh’

        ——————————————分割线
        这个IP好像打不开的,人都要麻了

      1. 2023/10/07 18:28:50 127.0.0.1:53407 accepted //self.events.data.microsoft.com:443 [test]
        2023/10/07 18:28:50 [Warning] [1408625087] 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: current time 2023-10-07T18:28:50+08:00 is after 2023-10-06T03:31:11Z
        2023/10/07 18:28:50 tcp:127.0.0.1:53409 accepted tcp:self.events.data.microsoft.com:443 [test]
        2023/10/07 18:28:51 [Warning] [929019693] 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: current time 2023-10-07T18:28:51+08:00 is after 2023-10-06T03:31:11Z
        2023/10/07 18:28:51 127.0.0.1:53411 accepted //self.events.data.microsoft.com:443 [test]
        2023/10/07 18:28:51 [Warning] [4190235252] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic
        > v2ray.com/core/proxy/vless/outbound: connection ends

        这个是macos上的log信息,求救!

      2. Loaded plugins: fastestmirror
        Loading mirror speeds from cached hostfile
        Could not retrieve mirrorlist http://mirrors.elrepo.org/mirrors-elrepo-kernel.el7 error was
        12: Timeout on http://mirrors.elrepo.org/mirrors-elrepo-kernel.el7: (28, ‘Connection timed out after 30000 milliseconds’)
        * base: http://ftp.riken.jp
        * elrepo-kernel: repos.lax-noc.com
        * epel: d2lzkl7pfhq30w.cloudfront.net
        * extras: http://ftp.riken.jp
        * updates: http://ftp.riken.jp
        补充

  3. tls handshake timeout 这个怎么解决?PC用了之后手机端口就一直显示这个了,无法

      1. 博主您好,想问下 vmess + ws + tls + web 的搭配从今年开始就一直墙端口。目前最推荐什么路线呢,最新的Vision和Reality是否稳呢?谢谢

          1. 谢谢博主哈,确实如您所说,我有一台就是一直用的这个路线,非443端口,套了cloudflare的,已经3年至少了。以您的经验判断的话,CDN要不要套上去

  4. Complete!
    Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: mirrors.oit.uci.edu
    * epel: irltoolkit.mm.fcix.net
    * extras: mirror.vacares.com
    * updates: la.mirrors.clouvider.net
    Package socat-1.7.3.2-2.el7.x86_64 already installed and latest version
    Package 1:openssl-1.0.2k-26.el7_9.x86_64 already installed and latest version
    Nothing to do
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: mirrors.oit.uci.edu
    * epel: irltoolkit.mm.fcix.net
    * extras: mirror.vacares.com
    * updates: la.mirrors.clouvider.net
    Package cronie-1.4.11-25.el7_9.x86_64 already installed and latest version
    Nothing to do
    /dev/fd/63: line 582: /root/.acme.sh/acme.sh: No such file or directory
    /dev/fd/63: line 583: /root/.acme.sh/acme.sh: No such file or directory
    /dev/fd/63: line 593: /root/.acme.sh/acme.sh: No such file or directory
    获取证书失败,请复制上面的红色文字到 https://www.hicairo.com 反馈

发表回复

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