add VLESS_WebSocket_TLS

This commit is contained in:
233boy
2020-11-08 18:19:44 +08:00
parent 750dcfc5d6
commit 8e944269f7
12 changed files with 499 additions and 340 deletions

View File

@@ -1,7 +1,7 @@
# local email=$(((RANDOM << 22)))
# tls ${email}@gmail.com
case $v2ray_transport in
4)
4|33)
if [[ $is_path ]]; then
cat >/etc/caddy/Caddyfile <<-EOF
$domain {

View File

@@ -24,7 +24,7 @@ _download_caddy_file() {
fi
}
_install_caddy_service() {
setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/caddy
# setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/caddy
if [[ $systemd ]]; then
cp -f ${caddy_tmp}init/linux-systemd/caddy.service /lib/systemd/system/
@@ -35,7 +35,7 @@ _install_caddy_service() {
if [[ ! $(grep "ReadWriteDirectories" /lib/systemd/system/caddy.service) ]]; then
sed -i "/ReadWritePaths/a ReadWriteDirectories=/etc/ssl/caddy" /lib/systemd/system/caddy.service
fi
# # sed -i "s/www-data/root/g" /lib/systemd/system/caddy.service
sed -i "s/www-data/root/g" /lib/systemd/system/caddy.service
# sed -i "/on-abnormal/a RestartSec=3" /lib/systemd/system/caddy.service
# sed -i "s/on-abnormal/always/" /lib/systemd/system/caddy.service
@@ -67,23 +67,23 @@ _install_caddy_service() {
systemctl enable caddy
else
cp -f ${caddy_tmp}init/linux-sysvinit/caddy /etc/init.d/caddy
# sed -i "s/www-data/root/g" /etc/init.d/caddy
sed -i "s/www-data/root/g" /etc/init.d/caddy
chmod +x /etc/init.d/caddy
update-rc.d -f caddy defaults
fi
if [ -z "$(grep www-data /etc/passwd)" ]; then
useradd -M -s /usr/sbin/nologin www-data
fi
# if [ -z "$(grep www-data /etc/passwd)" ]; then
# useradd -M -s /usr/sbin/nologin www-data
# fi
# chown -R www-data.www-data /etc/ssl/caddy
# ref https://github.com/caddyserver/caddy/tree/master/dist/init/linux-systemd
mkdir -p /etc/caddy
chown -R root:root /etc/caddy
# chown -R root:root /etc/caddy
mkdir -p /etc/ssl/caddy
chown -R root:www-data /etc/ssl/caddy
chmod 0770 /etc/ssl/caddy
# chown -R root:www-data /etc/ssl/caddy
# chmod 0770 /etc/ssl/caddy
## create sites dir
mkdir -p /etc/caddy/sites

View File

@@ -1,3 +1,12 @@
###----
echo
echo -e "$red V2RAY Telegram MTProto 相关配置暂时不推荐使用 $none"
echo
echo -e "$green 推荐使用 https://github.com/cutelua/mtg-dist $none"
echo
exit
###----
_view_mtproto_info() {
if [[ $mtproto ]]; then
_mtproto_info

View File

@@ -14,9 +14,9 @@ if [[ $shadowsocks ]]; then
echo
echo -e "$yellow SS 链接 = ${cyan}$ss$none"
echo
echo -e " 备注:$red Shadowsocks Win 4.0.6 $none客户端可能无法识别该 SS 链接"
echo -e " 备注: $red Shadowsocks Win 4.0.6 $none 客户端可能无法识别该 SS 链接"
echo
echo -e "提示: 输入$cyan v2ray ssqr $none可生成 Shadowsocks 二维码链接"
echo -e "提示: 输入 $cyan v2ray ssqr $none 可生成 Shadowsocks 二维码链接"
echo
echo -e "${yellow}免被墙..推荐使用JMS: ${cyan}https://getjms.com${none}"
echo

View File

@@ -31,4 +31,5 @@ transport=(
QUIC_wechat-video_dynamicPort
QUIC_dtls_dynamicPort
QUIC_wireguard_dynamicPort
VLESS_WebSocket_TLS
)

View File

@@ -58,28 +58,28 @@ if [[ $is_uninstall_v2ray && $is_uninstall_caddy ]]; then
pause
echo
if [[ $shadowsocks ]]; then
del_port $ssport
fi
if [[ $socks ]]; then
del_port $socks_port
fi
if [[ $mtproto ]]; then
del_port $mtproto_port
fi
# if [[ $shadowsocks ]]; then
# del_port $ssport
# fi
# if [[ $socks ]]; then
# del_port $socks_port
# fi
# if [[ $mtproto ]]; then
# del_port $mtproto_port
# fi
if [[ $v2ray_transport == [45] ]]; then
del_port "80"
del_port "443"
del_port $v2ray_port
elif [[ $v2ray_transport -ge 18 ]]; then
del_port $v2ray_port
del_port "multiport"
else
del_port $v2ray_port
fi
# if [[ $v2ray_transport == [45] ]]; then
# del_port "80"
# del_port "443"
# del_port $v2ray_port
# elif [[ $v2ray_transport -ge 18 ]]; then
# del_port $v2ray_port
# del_port "multiport"
# else
# del_port $v2ray_port
# fi
[ $cmd == "apt-get" ] && rm -rf /etc/network/if-pre-up.d/iptables
[[ -f /etc/network/if-pre-up.d/iptables ]] && rm -rf /etc/network/if-pre-up.d/iptables
# [ $v2ray_pid ] && systemctl stop v2ray
[ $v2ray_pid ] && do_service stop v2ray
@@ -121,28 +121,28 @@ elif [[ $is_uninstall_v2ray ]]; then
pause
echo
if [[ $shadowsocks ]]; then
del_port $ssport
fi
if [[ $socks ]]; then
del_port $socks_port
fi
if [[ $mtproto ]]; then
del_port $mtproto_port
fi
# if [[ $shadowsocks ]]; then
# del_port $ssport
# fi
# if [[ $socks ]]; then
# del_port $socks_port
# fi
# if [[ $mtproto ]]; then
# del_port $mtproto_port
# fi
if [[ $v2ray_transport == [45] ]]; then
del_port "80"
del_port "443"
del_port $v2ray_port
elif [[ $v2ray_transport -ge 18 ]]; then
del_port $v2ray_port
del_port "multiport"
else
del_port $v2ray_port
fi
# if [[ $v2ray_transport == [45] ]]; then
# del_port "80"
# del_port "443"
# del_port $v2ray_port
# elif [[ $v2ray_transport -ge 18 ]]; then
# del_port $v2ray_port
# del_port "multiport"
# else
# del_port $v2ray_port
# fi
[ $cmd == "apt-get" ] && rm -rf /etc/network/if-pre-up.d/iptables
[[ -f /etc/network/if-pre-up.d/iptables ]] && rm -rf /etc/network/if-pre-up.d/iptables
# [ $v2ray_pid ] && systemctl stop v2ray
[ $v2ray_pid ] && do_service stop v2ray

View File

@@ -15,7 +15,7 @@ _v2_args() {
header="http"
host="www.baidu.com"
;;
3 | 4 | 20)
3 | 4 | 20 | 33)
net="ws"
;;
5)
@@ -96,7 +96,35 @@ _v2_info() {
echo
echo -e "$yellow 路径 (path) = ${cyan}${_path}$none"
echo
echo -e "$yellow TLS (Enable TLS) = ${cyan}打开$none"
echo -e "$yellow 底层传输安全 (TLS) = ${cyan}tls$none"
echo
if [[ $ban_ad ]]; then
echo " 备注: 广告拦截已开启.."
echo
fi
elif [[ $v2ray_transport == 33 ]]; then
echo
echo -e "$green ---提示..这是 VLESS 服务器配置--- $none"
echo
echo -e "$yellow 地址 (Address) = $cyan${domain}$none"
echo
echo -e "$yellow 端口 (Port) = ${cyan}443${none}"
echo
echo -e "$yellow 用户ID (User ID / UUID) = $cyan${v2ray_id}$none"
echo
echo -e "$yellow 流控 (Flow) = ${cyan}${none}"
echo
echo -e "$yellow 加密 (Encryption) = ${cyan}none${none}"
echo
echo -e "$yellow 传输协议 (Network) = ${cyan}${net}$none"
echo
echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none"
echo
echo -e "$yellow 伪装域名 (host) = ${cyan}${domain}$none"
echo
echo -e "$yellow 路径 (path) = ${cyan}${_path}$none"
echo
echo -e "$yellow 底层传输安全 (TLS) = ${cyan}tls$none"
echo
if [[ $ban_ad ]]; then
echo " 备注: 广告拦截已开启.."
@@ -131,7 +159,7 @@ _v2_info() {
echo
echo "V2Ray 客户端使用教程: https://233v2.com/post/4/"
echo
echo -e "提示: 输入$cyan v2ray url $none可生成 vmess URL 链接 / 输入$cyan v2ray qr $none可生成二维码链接"
echo -e "提示: 输入 $cyan v2ray url $none 可生成 vmess URL 链接 / 输入 $cyan v2ray qr $none 可生成二维码链接"
echo
echo -e "${yellow}免被墙..推荐使用JMS: ${cyan}https://getjms.com${none}"
echo

View File

@@ -44,6 +44,10 @@ case $v2ray_transport in
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/dynamic/kcp.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json"
;;
33)
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/vless_ws.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/vless_ws_tls.json"
;;
*)
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/dynamic/quic.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/quic.json"
@@ -58,7 +62,7 @@ cp -f $v2ray_client_config_file $v2ray_client_config
sed -i "9s/2333/$v2ray_port/; 14s/$old_id/$v2ray_id/; 16s/233/$alterId/" $v2ray_server_config
# change dynamic port
if [[ $v2ray_transport -ge 18 ]]; then
if [[ $v2ray_transport -ge 18 && $v2ray_transport -ne 33 ]]; then
local multi_port="${v2ray_dynamicPort_start}-${v2ray_dynamicPort_end}"
sed -i "s/10000-20000/$multi_port/" $v2ray_server_config
fi
@@ -97,7 +101,7 @@ esac
## change client config file
[[ -z $ip ]] && get_ip
if [[ $v2ray_transport == [45] ]]; then
if [[ $v2ray_transport == [45] || $v2ray_transport == 33 ]]; then
sed -i "s/233blog.com/$domain/; 9s/2333/443/; 12s/$old_id/$v2ray_id/; 13s/233/$alterId/" $v2ray_client_config
if [[ $is_path ]]; then
sed -i "27s/233blog/$path/" $v2ray_client_config