当前位置:首页 > 未分类 > 正文内容

永不被封的vmess+ws搭建教程,实现域前置

freeai10个月前 (11-19)未分类2977

使用 VMess 协议结合 WebSocket(WS)和前置 CDN 的方案具有以下优点:

  1. 隐蔽性:WebSocket 协议可以伪装成正常的 Web 流量,这使得 VMess+WS 流量更难被检测和阻断。

  2. 穿透性:WebSocket 通常能够穿透企业和国家级的防火墙。

  3. 性能:使用 CDN 可以优化数据传输速度,减少延迟,尤其是在跨国连接时。

  4. 安全性:VMess 协议本身包含加密和认证机制,确保数据传输的安全性。

  5. 稳定性:结合 CDN 使用,流量的分发更加均匀,有助于提高系统的稳定性和可靠性。

请注意,虽然这种配置增强了隐蔽性和穿透力,但没有任何技术可以保证100%的不被屏蔽,特别是在不断变化的网络审查环境下。


教程代码:

在云服务器上安装 V2Ray :

更新系统

sudo apt update

安装依赖包

sudo apt install curl unzip

下载载并运行 V2Ray 安装脚本

curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh

给脚本加上执行权限

chmod +x install-release.sh

安装脚本

sudo bash install-release.sh

使用nano编辑器给v2ray添加配置代码

sudo nano /usr/local/etc/v2ray/config.json

配置V2ray config.json代码

{
  "log": {
    "loglevel": "warning",
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log"
  },
  "inbounds": [
    {
      "port": 10000,
      "listen": "127.0.0.1",
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "id": "改成自己的uuid",
            "alterId": 64
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "wsSettings": {
          "path": "/ray"
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}

关闭防火墙

ufw disable

启动 V2Ray 服务

sudo systemctl start v2ray

检查 V2Ray 服务状态

systemctl status v2ray

设置 V2Ray 自动启动

sudo systemctl enable v2ray

再次检查 V2Ray 服务状态

systemctl status v2ray

安装Nginx作为反向代理:

首先云将服务器ip地址指向域名,给域名添加记录,使用cloudclfare解析域名

安装 Nginx

sudo apt install nginx

创建并配置 Nginx 虚拟主机文件

sudo nano /etc/nginx/conf.d/v2ray.conf

配置代码

server {
  listen 80;
  server_name    自己的域名;

  index index.html;
  root /usr/share/nginx/html/;

  access_log /var/log/nginx/v2ray.access;
  error_log /var/log/nginx/v2ray.error;

  location /ray {
    if ($http_upgrade != "websocket") {
      return 404;
    }
    proxy_redirect off;
    proxy_pass http://127.0.0.1:10000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}


重启 Nginx 服务

sudo systemctl restart nginx

检查nginx是否已经成功启动

sudo systemctl status nginx

设置Nginx 自动启动

sudo systemctl enable nginx

再次检查Nginx状态

systemctl status nginx

最后在浏览器中打开域名,出现以下提示,表示成功

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at 
nginx.com.

Thank you for using nginx.


配置客户端:

下载v2ray和xray

xray下载地址:https://github.com/XTLS/Xray-core/releases/tag/v1.8.4

v2ray下载地址:https://github.com/v2fly/v2ray-core/releases










“永不被封的vmess+ws搭建教程,实现域前置” 的相关文章

stable diffusion网盘下载链接

stable diffusion网盘下载链接

这个stable diffusion文件大概有10G左右,无需环境,也不用安装,解压就可以使用stable diffusion网盘链接:https://pan.baidu.com/s/1Yw9dXe9NN6kmP2hS6ATVbw 提取码:ivoh提示词:    &nb...

Warp工具包下载和秘钥获取链接

warp下载链接:https://pan.baidu.com/s/1Gu3h4USTzHro0qo1wr_R-g                          &nb...

intel vps免费申请链接

Intel账号申请链接:https://www.intel.com/content/www/us/en/developer/tools/devcloud/services.htmlintel VPS申请链接:https://scheduler.cloud.intel.com/#/systemputt...

可以申请Oracle的信用卡

可以申请Oracle的信用卡

大家不要盲目购买信用卡,要注意保护个人的隐私,手里有一张信用卡就可以了1、Fomepay免年费信用卡申请链接:https://gpt.fomepay.com/#/pages/cards/index2、Dupay信用卡申请链接:https://dupay.one/zh-cn/index.html3、M...

linuxone2核4G内存50G硬盘免费VPS

linuxon免费VPS:https://linuxone.cloud.marist.edu/#/login搭建搭建v2r vpn节点代码:bash <(wget -qO- -o- https://git.io/v2ray.sh)...

美国静态ip如何在手机上使用

美国静态ip如何在手机上使用

静态IP proxy-cheap链接:https://www.proxy-cheap.com/V2rayN下载链接:https://github.com/2dust/v2rayN/releases美区苹果共享账号:https://cxkun.com/sites/12.html/注意!注意!注意!注意...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。