Giter Site home page Giter Site logo

crazypeace / v2ray_wss Goto Github PK

View Code? Open in Web Editor NEW
348.0 5.0 103.0 172 KB

V2ray v4.45.2,VLESS_WebSocket_TLS模式 / Vmess_WebSocket_TLS模式,极简一键脚本, CaddyV2前置解除TLS和path。支持带参数 域名 IP栈 UUID path 减少安装过程中的交互

Home Page: https://zelikk.blogspot.com/2022/11/v2ray-vless-vmess-websocket-cdn-tls-caddy-v2.html

License: GNU Affero General Public License v3.0

Shell 100.00%
v2ray vless websocket tls caddy vmess

v2ray_wss's Introduction

重要更新记录 (点击展开)

2022-10-30

脚本把VLESS协议搭好后,会提示你要不要切换为Vmess协议。 直接回车默认为不要切换。输入Y再回车就会切换为Vmess协议,并显示链接和二维码。

本质上就是执行了一下下面这条命令而已。意思是把config.json文件中的vless替换为vmess

sed -i "s/vless/vmess/g" /usr/local/etc/v2ray/config.json

所以如果你想vmess换成vless,就用下面这条命令

sed -i "s/vmess/vless/g" /usr/local/etc/v2ray/config.json

当然每次换完要记得重启v2ray

service v2ray restart

2022-9-19

Hax / Woiden 站长时不时的把机器人验证调得很难,于是续期非常容易失败。 那么把搭梯子的脚本简单化

apt update && apt install -y curl && bash <(curl -L https://github.com/crazypeace/v2ray_wss/raw/main/install.sh) 你的域名 6 你的UUID 你的path

跑这条命令之前,把CDN关闭。跑完之后再把CDN打开。 这样搭出来的梯子,你的翻墙客户端节点信息不用改。

2022-9-8

本脚本指定安装V2ray v4.45.2 (v5之前的最后一个v4)

相关信息 v2fly/fhs-install-v2ray#243

说明

这个一键脚本超级简单。有效语句11行(其中BBR 5行, 安装V2Ray 1行, 安装Caddy 5行)+Caddy配置文件18行(其中你需要修改4行)+V2Ray配置文件89行(其中你需要修改2行), 其它都是用来检验小白输入错误参数或者搭建条件不满足的。

你如果不放心开源的脚本,你可以自己执行那11行有效语句,再修改配置文件中的6行,也能达到一样的效果。

一键安装

apt update
apt install -y curl
bash <(curl -L https://github.com/crazypeace/v2ray_wss/raw/main/install.sh)

脚本中很大部分都是在校验用户的输入。其实照着下面的步骤自己配置就行了。

具体手搓步骤 (点击展开)

打开BBR

sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
sed -i '/net.core.default_qdisc/d' /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control = bbr" >>/etc/sysctl.conf
echo "net.core.default_qdisc = fq" >>/etc/sysctl.conf
sysctl -p >/dev/null 2>&1

安装V2ray v4.45.2

source: https://github.com/v2fly/fhs-install-v2ray

bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh) --version 4.45.2

安装CaddyV2最新版本

source: https://caddyserver.com/docs/install#debian-ubuntu-raspbian

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

如果已经装过了Caddy, 重装的时候脚本会问你

File '/usr/share/keyrings/caddy-stable-archive-keyring.gpg' exists. Overwrite? (y/N)

输入 y 回车。

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

{ // VLESS + WebSocket + TLS
    "log": {
        "access": "/var/log/v2ray/access.log",
        "error": "/var/log/v2ray/error.log",
        "loglevel": "warning"
    },
    "inbounds": [
        {
            "listen": "127.0.0.1",        
            "port": 你的v2ray内部端口,             // ***改这里
            "protocol": "vless",
            "settings": {
                "clients": [
                    {
                        "id": "你的v2rayID",             // ***改这里
                        "level": 1,
                        "alterId": 0
                    }
                ],
                "decryption": "none"
            },
            "streamSettings": {
                "network": "ws"
            },
            "sniffing": {
                "enabled": true,
                "destOverride": [
                    "http",
                    "tls"
                ]
            }
        }
    ],
    "outbounds": [
        {
            "protocol": "freedom",
            "settings": {
                "domainStrategy": "UseIP"
            },
            "tag": "direct"
        },
        {
            "protocol": "blackhole",
            "settings": {},
            "tag": "blocked"
        }
    ],
    "dns": {
        "servers": [
            "https+local://8.8.8.8/dns-query",
            "8.8.8.8",
            "1.1.1.1",
            "localhost"
        ]
    },
    "routing": {
        "domainStrategy": "IPOnDemand",
        "rules": [
            {
                "type": "field",
                "ip": [
                    "0.0.0.0/8",
                    "10.0.0.0/8",
                    "100.64.0.0/10",
                    "127.0.0.0/8",
                    "169.254.0.0/16",
                    "172.16.0.0/12",
                    "192.0.0.0/24",
                    "192.0.2.0/24",
                    "192.168.0.0/16",
                    "198.18.0.0/15",
                    "198.51.100.0/24",
                    "203.0.113.0/24",
                    "::1/128",
                    "fc00::/7",
                    "fe80::/10"
                ],
                "outboundTag": "blocked"
            },
            {
                "type": "field",
                "protocol": [
                    "bittorrent"
                ],
                "outboundTag": "blocked"
            }
        ]
    }
}

配置 /etc/caddy/Caddyfile

你的域名     # 改这里
{
    tls [email protected]
    encode gzip

    handle_path /分流path {     # 改这里
        reverse_proxy localhost:你的v2ray内部端口     # 改这里
    }
    handle {
        reverse_proxy https://你反代伪装的网站 {     # 改这里
            trusted_proxies 0.0.0.0/0
            header_up Host {upstream_hostport}
        }
    }
}

如果想多用户使用,可以通过多path的方式

你的域名     # 改这里
{
    tls [email protected]
    encode gzip

@ws_path {
    path /分流path1     # 改这里
    path /分流path2     # 改这里
    path /分流path3     # 改这里
}

    handle @ws_path {
        uri path_regexp /.* /
        reverse_proxy localhost:你的v2ray内部端口     # 改这里
    }
    handle {
        reverse_proxy https://你反代伪装的网站 {     # 改这里
            trusted_proxies 0.0.0.0/0
            header_up Host {upstream_hostport}
        }
    }
}

可参考视频 https://www.youtube.com/watch?v=bfZh_eaYJLE&t=220s

如果是 IPv6 only 的小鸡,用 WARP 添加 IPv4 出站能力

bash <(curl -L git.io/warp.sh) 4

Uninstall

bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh) --remove
rm /etc/apt/sources.list.d/caddy-stable.list
apt remove -y caddy

私货

对于喜欢V2rayN PAC模式的朋友,欢迎使用支持VLESS链接导入功能的 v2rayN-3.29-VLESS v2rayN_2022-07-20_22-02-43

带参数执行

如果你已经很熟悉了, 安装过程中的参数都确认没问题. 可以带参数使用本脚本, 跳过脚本中的各种校验.

bash <(curl -L https://github.com/crazypeace/v2ray_wss/raw/main/install.sh) <domain> [netstack] [UUID] [path]

其中

domain 你的域名

netstask 6 表示 IPv6入站, 最后会安装WARP获得IPv4出站

UUID 你的UUID

path 你的path,如果不输入,会从UUID自动生成

例如

bash <(curl -L https://github.com/crazypeace/v2ray_wss/raw/main/install.sh) abc.mydomain.com
bash <(curl -L https://github.com/crazypeace/v2ray_wss/raw/main/install.sh) abccba.ipv6d.my.id 6
bash <(curl -L https://github.com/crazypeace/v2ray_wss/raw/main/install.sh) abccba.ipv6d.my.id 6 486572e1-11d5-4e93-a41d-d4b9775870bd
bash <(curl -L https://github.com/crazypeace/v2ray_wss/raw/main/install.sh) abccba.ipv6d.my.id 6 486572e1-11d5-4e93-a41d-d4b9775870bd somepath

用你的STAR告诉我这个Repo对你有用 Welcome STARs! :)

Stargazers over time

v2ray_wss's People

Contributors

crazypeace avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

v2ray_wss's Issues

部署完成后caddy.service重启出错

用的小鸡是HAX的./EU-OpenVZ, 也按照教程开启了Tun服务

Job for caddy.service failed because the control process exited with error code.
See "systemctl status caddy.service" and "journalctl -xe" for details.

INFO] Status check in progress...


WireGuard : Running
IPv4 Network : WARP
IPv6 Network : Normal

[INFO] Done.

重启 V2Ray

重启 CaddyV2

Job for caddy.service failed because the control process exited with error code.
See "systemctl status caddy.service" and "journalctl -xe" for details.

关于crazypeace/v2ray的问题

4.27.0链接已经404,原项目没开issue,只能跑过来提交一下了

主机时间:
Local time: Mon 2022-04-18 23:34:14 CST
Time zone: Asia/Shanghai (CST, +0800)

指定下载 V2Ray v4.27.0!!!
--2022-04-18 23:34:14-- https://github.com/v2fly/v2ray-core/releases/download/v4.27.0/v2ray-linux-arm64.zip
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-04-18 23:34:15 ERROR 404: Not Found.

     下载 V2Ray 失败啦..可能是你的 VPS 网络太辣鸡了...请重试...

想让naive proxy 在小鸡上与vless共存

想让naive proxy 在小鸡上与vless共存
已经搭建好了naive proxy 安装了v2ray
如何编辑Caddyfile 加入naive proxy的配置内容?

目前是一个caddy_config.json 的文件如下,请教如何加入vless的配置内容

{
  "admin": {
    "disabled": true
  },
  "apps": {
    "http": {
      "servers": {
        "srv0": {
          "listen": [
            ":443"
          ],
          "routes": [
            {
              "handle": [
                {
                  "handler": "subroute",
                  "routes": [
                    {
                      "handle": [
                        {
                          "auth_user_deprecated": "xxxx",
                          "auth_pass_deprecated": "xxxx",
                          "handler": "forward_proxy",
                          "hide_ip": true,
                          "hide_via": true,
                          "probe_resistance": {}
                        }
                      ]
                    },
                    {
                      "match": [
                        {
                          "host": [
                            "xxxx.ipv6a.my.id"
                          ]
                        }
                      ],
                      "handle": [
                        {
                          "handler": "file_server",
                          "root": "/var/www/html",
                          "index_names": [
                            "index.html"
                          ]
                        }
                      ],
                      "terminal": true
                    }
                  ]
                }
              ]
            }
          ],
          "tls_connection_policies": [
            {
              "match": {
                "sni": [
                  "xxxx.ipv6a.my.id"
                ]
              }
            }
          ],
          "automatic_https": {
            "disable": true
          }
        }
      }
    },
    "tls": {
      "certificates": {
        "load_files": [
          {
            "certificate": "/etc/letsencrypt/live/xxxx.ipv6a.my.id/fullchain.pem",
            "key": "/etc/letsencrypt/live/xxxx.ipv6a.my.id/privkey.pem"
          }
        ]
      }
    }
  }
}

请问如何自动续期证书呢?

用的下面的历史脚本:

bash <(curl -L https://github.com/crazypeace/V2ray_VLESS_WebSocket_TLS_CaddyV2/raw/main/install.sh)

请问如何自动续期证书呢?

脚本获取到的vps IP跟实际IP不符

vps info

Username
root
Nat VPS
IPv6
2001:41d0:800:17ac:1234:4321:52ac:0001

dns pointing

registw.ipv6d.my.id | [2001:41d0:800:17ac:1234:4321:52ac:0001]

脚本输出

 域名解析错误Domain resolution error....

 你的域名: registw.ipv6d.my.id 未解析到: 2001:41d0:800:17ac::1

 你的域名当前解析到: 2001:41d0:800:17ac:1234:4321:52ac:1

websocket 握手失败

日志如下
2022/09/02 23:32:32 [Warning] [331184489] app/proxyman/outbound: failed to process outbound traffic > proxy/vless/outbound: failed to find an available destination > common/retry: [transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (wss://xxxxxxxxxxxxxxx/1234): 200 OK > websocket: bad handshake] > common/retry: all retry attempts failed
2022/09/02 23:32:32 [Warning] [1167798755] app/proxyman/outbound: failed to process outbound traffic > proxy/vless/outbound: failed to find an available destination > common/retry: [transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (wss://xxxxxxxxxxxxxxx/1234): 200 OK > websocket: bad handshake] > common/retry: all retry attempts failed
2022/09/02 23:32:32 [Warning] [3448469764] app/proxyman/outbound: failed to process outbound traffic > proxy/vless/outbound: failed to find an available destination > common/retry: [transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (wss://xxxxxxxxxxxxxxx/1234): 200 OK > websocket: bad handshake] > common/retry: all retry attempts failed

Ask

how to run ws non tls and tls at the same time?

大神你好,遇到问题想请教一下

大神你好,我是看的这个帖子进行操作的,全程安装攻略进行,对照日志排查出有可能是这个原因,帮忙看看为什么安装不了?
https://zelikk.blogspot.com/2022/04/woiden-ipv6-vps-v2ray-vless-websocket-tls.html

错误日志:
指定安装V2ray v4.45.2版本

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 22189 100 22189 0 0 160k 0 --:--:-- --:--:-- --:--:-- 160k
info: Installing V2Ray v4.45.2 for x86_64
Downloading V2Ray archive: https://github.com/v2fly/v2ray-core/releases/download/v4.45.2/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 --:--:-- --:--:-- --:--:-- 0Terminated
error: Download failed! Please check your network or try again.
removed: /tmp/tmp.XubRS5r9MW
Failed to enable unit: Unit file v2ray.service does not exist.

脚本使用的是这个
bash <(curl -L https://github.com/crazypeace/V2ray_VLESS_WebSocket_TLS_CaddyV2/raw/main/install.sh)

Options for command line

How to change redirect site, but not through editing .sh file? Can you add option for command line, please?
And also options for changing ws/grpc.

Input 4 for IPv4, 6 for IPv6:

非预设参数手动输入域名后,再Input 4 for IPv4, 6 for IPv6:阶段直接回车会卡住,过段时间会报错提示输入的域名没有解析到本机对应的ip,但是已经成功ip解析了域名

Error WSS

[13:40:31] failed to handler mux client connection > proxy/vless/outbound: failed to find an available destination > common/retry: [transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (:///*): 308 Permanent Redirect > websocket: bad handshake] > common/retry: all retry attempts failed

I don't understand the problem where I have tried reinstalling with a different domain and server but still the same error like that

大佬,请问下kcp的问题。

脚本安装后,另外加了kcp协议,但是使用warp的时候kcp的就会连接失败,把warp关了,就能连通,是不是要修改什么配置文件?outbound那里需要另外设置吗?

端口443问题

安装时已自定义端口 安装后怎么配置显示是443端口?我的vps的443端口被封了。

求助!cloudflare 代理后 ipv4 环境无法访问

1、vps 信息

纯 ipv6 环境,使用 warp 添加了 ipv4 的出站。

2、操作步骤

  • 使用 bash <(curl -L https://github.com/crazypeace/v2ray_wss/raw/main/install.sh) <域名> d 部署服务。
  • cloudflare 开启了代理。

image

3、 结果

  • 在移动环境下(支持 ipv6)下,可以正常访问域名并且进入伪装网站。
  • 在 wifi 环境下(仅支持 ipv4),无法访问域名,无法进入位置网站。

麻烦请问下,cloudflare 还需要额外的配置吗?
还是我少了哪一步骤。域名是 nl.eu.org 后缀的。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.