support socks5

pull/197/head^2
233boy 7 years ago
parent 001fd37343
commit d8515991d1
  1. 6
      config/backup.conf
  2. 13215
      config/blocked_hosts/server/socks.json
  3. 13228
      config/blocked_hosts/server/socks_ss.json
  4. 104
      config/client/socks.json
  5. 62
      config/server/socks.json
  6. 75
      config/server/socks_ss.json
  7. 199
      install.sh
  8. 12
      tools/support_socks.sh
  9. 471
      v2ray.sh

@ -61,3 +61,9 @@ path=233blog
#---- 伪装的网址 ----- #---- 伪装的网址 -----
proxy_site=https://liyafly.com proxy_site=https://liyafly.com
#---- Socks 用户名 -----
username=233blog
#---- Socks 密码 -----
userpass=233blog.com

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,104 @@
{
"log": {
"error": "error.log",
"loglevel": "warning"
},
"inbound": {
"port": 2333,
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": true,
"ip": "127.0.0.1"
}
},
"outbound": {
"protocol": "socks",
"settings": {
"servers": [
{
"address": "233blog.com",
"port": 2333,
"users": [
{
"user": "233blog",
"pass": "233blog.com",
"level": 1
}
]
}
]
},
"mux": {
"enabled": true
}
},
"inboundDetour": [
{
"port": 6666,
"listen": "127.0.0.1",
"protocol": "http",
"settings": {
"auth": "noauth",
"udp": true,
"ip": "127.0.0.1"
}
}
],
"outboundDetour": [
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
}
],
"dns": {
"servers": [
"8.8.8.8",
"8.8.4.4",
"localhost"
]
},
"routing": {
"strategy": "rules",
"settings": {
"domainStrategy": "IPIfNonMatch",
"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",
"geoip:cn"
],
"domain": [
"geosite:cn"
],
"outboundTag": "direct"
},
{
"type": "chinasites",
"outboundTag": "direct"
},
{
"type": "chinaip",
"outboundTag": "direct"
}
]
}
}
}

@ -0,0 +1,62 @@
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"port": 2333,
"protocol": "socks",
"settings": {
"auth": "password",
"accounts": [
{
"user": "233blog",
"pass": "233blog.com"
}
],
"udp": true,
"timeout": 0,
"userLevel": 1
}
},
"outbound": {
"protocol": "freedom",
"settings": {}
},
"outboundDetour": [
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"routing": {
"strategy": "rules",
"settings": {
"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"
}
]
}
}
}

@ -0,0 +1,75 @@
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"port": 2333,
"protocol": "socks",
"settings": {
"auth": "password",
"accounts": [
{
"user": "233blog",
"pass": "233blog.com"
}
],
"udp": true,
"timeout": 0,
"userLevel": 1
}
},
"outbound": {
"protocol": "freedom",
"settings": {}
},
"inboundDetour": [
{
"protocol": "shadowsocks",
"port": 6666,
"settings": {
"method": "chacha20-ietf",
"password": "233blog.com",
"udp": true,
"level": 1,
"ota": false
}
}
],
"outboundDetour": [
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"routing": {
"strategy": "rules",
"settings": {
"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"
}
]
}
}
}

@ -63,6 +63,7 @@ transport=(
mKCP_srtp_dynamicPort mKCP_srtp_dynamicPort
mKCP_wechat-video_dynamicPort mKCP_wechat-video_dynamicPort
HTTP/2 HTTP/2
Socks5
) )
ciphers=( ciphers=(
@ -98,7 +99,7 @@ v2ray_config() {
read -p "$(echo -e "(默认协议: ${cyan}TCP$none)"):" v2ray_transport_opt read -p "$(echo -e "(默认协议: ${cyan}TCP$none)"):" v2ray_transport_opt
[ -z "$v2ray_transport_opt" ] && v2ray_transport_opt=1 [ -z "$v2ray_transport_opt" ] && v2ray_transport_opt=1
case $v2ray_transport_opt in case $v2ray_transport_opt in
[1-9] | 1[0-6]) [1-9] | 1[0-7])
echo echo
echo echo
echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport_opt - 1]}$none" echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport_opt - 1]}$none"
@ -115,7 +116,7 @@ v2ray_config() {
} }
v2ray_port_config() { v2ray_port_config() {
case $v2ray_transport_opt in case $v2ray_transport_opt in
[1-3] | [5-9] | 1[0-5]) [1-3] | [5-9] | 1[0-5] | 17)
local random=$(shuf -i20001-65535 -n1) local random=$(shuf -i20001-65535 -n1)
while :; do while :; do
echo -e "请输入 "$yellow"V2Ray"$none" 端口 ["$magenta"1-65535"$none"]" echo -e "请输入 "$yellow"V2Ray"$none" 端口 ["$magenta"1-65535"$none"]"
@ -137,6 +138,9 @@ v2ray_port_config() {
done done
if [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]]; then if [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]]; then
v2ray_dynamic_port_start v2ray_dynamic_port_start
elif [[ $v2ray_transport_opt == 17 ]]; then
socks_user_config
socks_pass_config
fi fi
;; ;;
*) *)
@ -213,6 +217,52 @@ v2ray_dynamic_port_end() {
} }
socks_user_config() {
while :; do
read -p "$(echo -e "请输入$yellow用户名$none...(默认用户名: ${cyan}233blog$none)"): " username
[ -z "$username" ] && username="233blog"
case $username in
*[/$]* | *\&*)
echo
echo -e " 由于这个脚本太辣鸡了..所以用户名不能包含$red / $none或$red $ $none或$red & $none这三个符号.... "
echo
error
;;
*)
echo
echo
echo -e "$yellow 用户名 = $cyan$username$none"
echo "----------------------------------------------------------------"
echo
break
;;
esac
done
}
socks_pass_config() {
while :; do
read -p "$(echo -e "请输入$yellow密码$none...(默认密码: ${cyan}233blog.com$none)"): " userpass
[ -z "$userpass" ] && userpass="233blog.com"
case $userpass in
*[/$]* | *\&*)
echo
echo -e " 由于这个脚本太辣鸡了..所以密码不能包含$red / $none或$red $ $none或$red & $none这三个符号.... "
echo
error
;;
*)
echo
echo
echo -e "$yellow 密码 = $cyan$userpass$none"
echo "----------------------------------------------------------------"
echo
break
;;
esac
done
}
tls_config() { tls_config() {
echo echo
@ -622,6 +672,18 @@ install_info() {
echo echo
echo -e "$yellow V2Ray 动态端口范围 = $cyan${v2ray_dynamic_port_start_input} - ${v2ray_dynamic_port_end_input}$none" echo -e "$yellow V2Ray 动态端口范围 = $cyan${v2ray_dynamic_port_start_input} - ${v2ray_dynamic_port_end_input}$none"
if [[ $is_blocked_ad ]]; then
echo
echo -e "$yellow 广告拦截 = $cyan$blocked_ad_info$none"
fi
elif [[ $v2ray_transport_opt == 17 ]]; then
echo
echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none"
echo
echo -e "$yellow 用户名 = $cyan$username$none"
echo
echo -e "$yellow 密码 = $cyan$userpass$none"
if [[ $is_blocked_ad ]]; then if [[ $is_blocked_ad ]]; then
echo echo
echo -e "$yellow 广告拦截 = $cyan$blocked_ad_info$none" echo -e "$yellow 广告拦截 = $cyan$blocked_ad_info$none"
@ -806,6 +868,7 @@ install_v2ray() {
$cmd install -y lrzsz git zip unzip curl wget qrencode libcap iptables-services $cmd install -y lrzsz git zip unzip curl wget qrencode libcap iptables-services
fi fi
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[ -d /etc/v2ray ] && rm -rf /etc/v2ray
if [[ $local_install ]]; then if [[ $local_install ]]; then
if [[ ! -d $(pwd)/config ]]; then if [[ ! -d $(pwd)/config ]]; then
@ -900,6 +963,10 @@ install_v2ray() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/h2_ss.json" v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/h2_ss.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json" v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json"
;; ;;
17)
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/socks_ss.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/socks.json"
;;
esac esac
else else
case $v2ray_transport_opt in case $v2ray_transport_opt in
@ -943,6 +1010,10 @@ install_v2ray() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/h2_ss.json" v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/h2_ss.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json" v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json"
;; ;;
17)
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/socks_ss.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/socks.json"
;;
esac esac
fi fi
else else
@ -988,6 +1059,10 @@ install_v2ray() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/h2.json" v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/h2.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json" v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json"
;; ;;
17)
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/socks.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/socks.json"
;;
esac esac
else else
case $v2ray_transport_opt in case $v2ray_transport_opt in
@ -1031,6 +1106,10 @@ install_v2ray() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/h2.json" v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/h2.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json" v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json"
;; ;;
17)
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/socks.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/socks.json"
;;
esac esac
fi fi
@ -1150,6 +1229,9 @@ config() {
16) 16)
sed -i "46s/6666/$ssport/; 48s/chacha20-ietf/$ssciphers/; 49s/233blog.com/$sspass/" $v2ray_server_config sed -i "46s/6666/$ssport/; 48s/chacha20-ietf/$ssciphers/; 49s/233blog.com/$sspass/" $v2ray_server_config
;; ;;
17)
sed -i "30s/6666/$ssport/; 32s/chacha20-ietf/$ssciphers/; 33s/233blog.com/$sspass/" $v2ray_server_config
;;
esac esac
case $v2ray_transport_opt in case $v2ray_transport_opt in
@ -1221,7 +1303,11 @@ config() {
fi fi
if [[ $v2ray_transport_opt == 17 ]]; then
sed -i "8s/2333/$v2ray_port/; 14s/233blog/$username/; 15s/233blog.com/$userpass/" $v2ray_server_config
else
sed -i "8s/2333/$v2ray_port/; 14s/$old_id/$uuid/" $v2ray_server_config sed -i "8s/2333/$v2ray_port/; 14s/$old_id/$uuid/" $v2ray_server_config
fi
if [[ $v2ray_transport_opt -eq 16 ]]; then if [[ $v2ray_transport_opt -eq 16 ]]; then
sed -i "24s/233blog.com/$domain/" $v2ray_server_config sed -i "24s/233blog.com/$domain/" $v2ray_server_config
@ -1239,6 +1325,8 @@ config() {
else else
sed -i "40s/233blog//" $v2ray_client_config sed -i "40s/233blog//" $v2ray_client_config
fi fi
elif [[ $v2ray_transport_opt == 17 ]]; then
sed -i "21s/233blog.com/$ip/; 22s/2333/$v2ray_port/; 25s/233blog/$username/; 26s/233blog.com/$userpass/" $v2ray_client_config
else else
sed -i "s/233blog.com/$ip/; 22s/2333/$v2ray_port/; 25s/$old_id/$uuid/" $v2ray_client_config sed -i "s/233blog.com/$ip/; 22s/2333/$v2ray_port/; 25s/$old_id/$uuid/" $v2ray_client_config
fi fi
@ -1294,7 +1382,9 @@ backup_config() {
sed -i "57s/=/=true/; 60s/=233blog/=$path/" $backup sed -i "57s/=/=true/; 60s/=233blog/=$path/" $backup
sed -i "63s#=https://liyafly.com#=$proxy_site#" $backup sed -i "63s#=https://liyafly.com#=$proxy_site#" $backup
fi fi
if [[ $v2ray_transport_opt == 17 ]]; then
sed -i "66s/=233blog/=$username/; 69s/=233blog.com/=$userpass/" $backup
fi
} }
try_enable_bbr() { try_enable_bbr() {
@ -1399,7 +1489,7 @@ show_config_info() {
"tls": "tls" "tls": "tls"
} }
EOF EOF
else elif [[ $v2ray_transport_opt != 17 ]]; then
cat >/etc/v2ray/vmess_qr.json <<-EOF cat >/etc/v2ray/vmess_qr.json <<-EOF
{ {
"v": "2", "v": "2",
@ -1416,16 +1506,6 @@ show_config_info() {
} }
EOF EOF
fi fi
# if [[ $obfs ]]; then
# if [[ $domain ]]; then
# ip_or_domain=$domain
# else
# ip_or_domain=$ip
# fi
# local shadowray_qr="vmess://$(echo -n "aes-128-cfb:${uuid}@${ip_or_domain}:${v2ray_port}" | base64)?remarks=233blog_v2ray_${ip_or_domain}&obfs=${obfs}"
# echo "${shadowray_qr}" >/etc/v2ray/shadowray_qr.txt
# sed -i 'N;s/\n//' /etc/v2ray/shadowray_qr.txt
# fi
clear clear
echo echo
echo "---------- V2Ray 安装完成 -------------" echo "---------- V2Ray 安装完成 -------------"
@ -1459,9 +1539,20 @@ show_config_info() {
echo echo
echo -e "$yellow TLS (Enable TLS) = ${cyan}打开$none" echo -e "$yellow TLS (Enable TLS) = ${cyan}打开$none"
echo echo
# echo -e " 请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) " elif [[ $v2ray_transport_opt == 17 ]]; then
# echo echo
echo -e "$yellow 主机 (Hostname) = $cyan${ip}$none"
echo
echo -e "$yellow 端口 (Port) = $cyan$v2ray_port$none"
echo
echo -e "$yellow 用户名 (Username) = $cyan${username}$none"
echo
echo -e "$yellow 密码 (Password) = $cyan${userpass}$none"
echo
echo -e "$yellow Telegram 代理配置链接 = ${cyan}tg://socks?server=${ip}&port=${v2ray_port}&user=${username}&pass=${userpass}$none"
echo
echo " 这是 Socks5 协议相关的配置啦.... 不用在乎一些 V2Ray 客户端 怎么没有这些东东配置的"
echo
else else
echo echo
echo -e "$yellow 地址 (Address) = $cyan${ip}$none" echo -e "$yellow 地址 (Address) = $cyan${ip}$none"
@ -1476,13 +1567,6 @@ show_config_info() {
echo echo
echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none" echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none"
echo echo
# if [[ $obfs ]]; then
# echo -e " 请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) "
# echo
# else
# echo -e " 帅帅的提示...此 V2Ray 配置不支持 Pepi / ShadowRay"
# echo
# fi
fi fi
if [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]] && [[ $is_blocked_ad ]]; then if [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]] && [[ $is_blocked_ad ]]; then
echo " 备注: 动态端口已启用...广告拦截已开启..." echo " 备注: 动态端口已启用...广告拦截已开启..."
@ -1511,11 +1595,15 @@ show_config_info() {
echo echo
echo -e " 备注:$red Shadowsocks Win 4.0.6 $none客户端可能无法识别该 SS 链接" echo -e " 备注:$red Shadowsocks Win 4.0.6 $none客户端可能无法识别该 SS 链接"
echo echo
if [[ $v2ray_transport_opt == 17 ]]; then
echo -e " 温馨提示: 使用${cyan} v2ray ssqr ${none}即可生成 Shadowsocks 配置信息二维码"
echo
fi
fi fi
} }
create_qr_link_ask() { create_qr_link_ask() {
if [[ $shadowsocks ]]; then if [[ $shadowsocks && $v2ray_transport_opt != 17 ]]; then
echo echo
while :; do while :; do
echo -e "是否需要生成$yellow V2Ray 和 Shadowsocks $none配置信息二维码链接 [${magenta}Y/N$none]" echo -e "是否需要生成$yellow V2Ray 和 Shadowsocks $none配置信息二维码链接 [${magenta}Y/N$none]"
@ -1532,7 +1620,7 @@ create_qr_link_ask() {
error error
fi fi
done done
else elif [[ $v2ray_transport_opt != 17 ]]; then
echo echo
while :; do while :; do
echo -e "是否需要生成$yellow V2Ray 配置信息 $none二维码链接 [${magenta}Y/N$none]" echo -e "是否需要生成$yellow V2Ray 配置信息 $none二维码链接 [${magenta}Y/N$none]"
@ -1557,25 +1645,16 @@ get_qr_link() {
echo -e "$green 正在生成链接.... 稍等片刻即可....$none" echo -e "$green 正在生成链接.... 稍等片刻即可....$none"
echo echo
# case $v2ray_transport_opt in
# [1-4] | 9 | 10 | 11)
# local ios_qr=true
# local random3=$(echo $RANDOM-$RANDOM-$RANDOM | base64)
# cat /etc/v2ray/shadowray_qr.txt | qrencode -s 50 -o /tmp/233blog_shadowray_qr.png
# local link3=$(curl -s --upload-file /tmp/233blog_shadowray_qr.png "https://transfer.sh/${random3}_233blog_v2ray.png")
# ;;
# esac
if [[ $1 ]]; then if [[ $1 ]]; then
local random1=$(echo $RANDOM-$RANDOM-$RANDOM | base64)
local random2=$(echo $RANDOM-$RANDOM-$RANDOM | base64)
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)" local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)"
echo $vmess >/etc/v2ray/vmess.txt echo $vmess >/etc/v2ray/vmess.txt
cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png
local link1=$(curl -s --upload-file /tmp/233blog_v2ray.png "https://transfer.sh/${random1}_233blog_v2ray.png")
local ss="ss://$(echo -n "${ssciphers}:${sspass}@${ip}:${ssport}" | base64)#233blog_ss_${ip}" local ss="ss://$(echo -n "${ssciphers}:${sspass}@${ip}:${ssport}" | base64)#233blog_ss_${ip}"
echo "${ss}" >/tmp/233blog_shadowsocks.txt echo "${ss}" >/tmp/233blog_shadowsocks.txt
cat /tmp/233blog_shadowsocks.txt | qrencode -s 50 -o /tmp/233blog_shadowsocks.png cat /tmp/233blog_shadowsocks.txt | qrencode -s 50 -o /tmp/233blog_shadowsocks.png
local random1=$(echo $RANDOM-$RANDOM-$RANDOM | base64)
local random2=$(echo $RANDOM-$RANDOM-$RANDOM | base64)
local link1=$(curl -s --upload-file /tmp/233blog_v2ray.png "https://transfer.sh/${random1}_233blog_v2ray.png")
local link2=$(curl -s --upload-file /tmp/233blog_shadowsocks.png "https://transfer.sh/${random2}_233blog_shadowsocks.png") local link2=$(curl -s --upload-file /tmp/233blog_shadowsocks.png "https://transfer.sh/${random2}_233blog_shadowsocks.png")
if [[ $link1 && $link2 ]]; then if [[ $link1 && $link2 ]]; then
echo echo
@ -1583,23 +1662,6 @@ get_qr_link() {
echo echo
echo -e "$yellow 适用于 V2RayNG v0.4.1+ / Kitsunebi = $cyan${link1}$none" echo -e "$yellow 适用于 V2RayNG v0.4.1+ / Kitsunebi = $cyan${link1}$none"
echo echo
# if [[ $ios_qr && $link3 ]]; then
# echo -e "$yellow 适用于 Pepi / ShadowRay = $cyan${link3}$none"
# echo
# echo " 请在 Pepi / ShadowRay 配置界面将 Alter Id 设置为 233 (如果你使用 Pepi / ShadowRay)"
# if [[ $v2ray_transport_opt == 4 ]]; then
# echo
# echo " 请在 Pepi / ShadowRay 配置界面打开 TLS (Enable TLS) (如果你使用 Pepi / ShadowRay)"
# if [[ $path ]]; then
# echo
# echo -e "$yellow 记得要将 WebSocket 路径 (WS path) 设置为: ${cyan}/${path}$none"
# fi
# fi
# elif [[ $ios_qr ]]; then
# echo -e "$red 生成适用于 Pepi / ShadowRay 的二维码链接 出错.... $none 请尝试使用${cyan} v2ray qr ${none}重新生成"
# else
# echo -e "$red 帅帅的提示...此 V2Ray 配置不支持 Pepi / ShadowRay...$none"
# fi
echo echo
echo echo
echo "---------- Shadowsocks 二维码链接 -------------" echo "---------- Shadowsocks 二维码链接 -------------"
@ -1628,34 +1690,19 @@ get_qr_link() {
rm -rf /tmp/233blog_shadowsocks.png rm -rf /tmp/233blog_shadowsocks.png
rm -rf /tmp/233blog_shadowsocks.txt rm -rf /tmp/233blog_shadowsocks.txt
else else
local random1=$(echo $RANDOM-$RANDOM-$RANDOM | base64)
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)" local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)"
echo $vmess >/etc/v2ray/vmess.txt echo $vmess >/etc/v2ray/vmess.txt
cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png
local random1=$(echo $RANDOM-$RANDOM-$RANDOM | base64)
local link1=$(curl -s --upload-file /tmp/233blog_v2ray.png "https://transfer.sh/${random1}_233blog_v2ray.png") local link1=$(curl -s --upload-file /tmp/233blog_v2ray.png "https://transfer.sh/${random1}_233blog_v2ray.png")
if [[ $link1 ]]; then if [[ $link1 ]]; then
echo echo
echo "---------- V2Ray 二维码链接 -------------" echo "---------- V2Ray 二维码链接 -------------"
echo echo
echo -e "$yellow 适用于 V2RayNG v0.4.1+ / Kitsunebi = $cyan${link1}$none" echo -e "$yellow 适用于 V2RayNG v0.4.1+ / Kitsunebi = $cyan${link1}$none"
echo echo
# if [[ $ios_qr && $link3 ]]; then
# echo -e "$yellow 适用于 Pepi / ShadowRay = $cyan${link3}$none"
# echo
# echo " 请在 Pepi / ShadowRay 配置界面将 Alter Id 设置为 233 (如果你使用 Pepi / ShadowRay)"
# if [[ $v2ray_transport_opt == 4 ]]; then
# echo
# echo " 请在 Pepi / ShadowRay 配置界面打开 TLS (Enable TLS) (如果你使用 Pepi / ShadowRay)"
# if [[ $path ]]; then
# echo
# echo -e "$yellow 记得要将 WebSocket 路径 (WS path) 设置为: ${cyan}/${path}$none"
# fi
# fi
# elif [[ $ios_qr ]]; then
# echo -e "$red 生成适用于 Pepi / ShadowRay 的二维码链接 出错.... $none 请尝试使用${cyan} v2ray qr ${none}重新生成"
# else
# echo -e "$red 帅帅的提示...此 V2Ray 配置不支持 Pepi / ShadowRay...$none"
# fi
echo echo
echo echo
echo "----------------------------------------------------------------" echo "----------------------------------------------------------------"
@ -1672,15 +1719,13 @@ get_qr_link() {
echo echo
fi fi
fi fi
rm -rf /tmp/233blog_v2ray.png rm -rf /tmp/233blog_v2ray.png
rm -rf /etc/v2ray/vmess_qr.json rm -rf /etc/v2ray/vmess_qr.json
rm -rf /etc/v2ray/vmess.txt rm -rf /etc/v2ray/vmess.txt
# if [[ $ios_qr ]]; then
# rm -rf /tmp/233blog_shadowray_qr.png
# rm -rf /etc/v2ray/shadowray_qr.txt
# fi
} }
install() { install() {
if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup && -d /etc/v2ray/233boy/v2ray ]]; then if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup && -d /etc/v2ray/233boy/v2ray ]]; then
echo echo

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
[[ $ws_path_status ]] && path_status=$ws_path_status
[[ $ws_path ]] && path=$ws_path
cat >$backup <<-EOF cat >$backup <<-EOF
# ----------------------------------- # -----------------------------------
# 警告...请不要修改或删除这个文件...谢谢 # 警告...请不要修改或删除这个文件...谢谢
@ -56,12 +58,18 @@ ssciphers=$ssciphers
blocked_ad_status=$blocked_ad_status blocked_ad_status=$blocked_ad_status
#---- 网站伪装 ----- #---- 网站伪装 -----
path_status=$ws_path_status path_status=$path_status
#---- 伪装的路径 ----- #---- 伪装的路径 -----
path=$ws_path path=$path
#---- 伪装的网址 ----- #---- 伪装的网址 -----
proxy_site=$proxy_site proxy_site=$proxy_site
#---- Socks5 用户名 -----
username=233blog
#---- Socks5 密码 -----
userpass=233blog.com
EOF EOF
. $backup . $backup

@ -10,7 +10,7 @@ none='\e[0m'
# Root # Root
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1
_version="v2.25" _version="v2.30"
cmd="apt-get" cmd="apt-get"
@ -48,8 +48,8 @@ if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup &
. $backup . $backup
v2ray_ver=$(/usr/bin/v2ray/v2ray -version | head -n 1 | cut -d " " -f2) v2ray_ver=$(/usr/bin/v2ray/v2ray -version | head -n 1 | cut -d " " -f2)
if [[ ! $path ]]; then if [[ ! $username ]]; then
. /etc/v2ray/233boy/v2ray/tools/support_h2.sh . /etc/v2ray/233boy/v2ray/tools/support_socks.sh
fi fi
elif [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f /etc/v2ray/233blog_v2ray_backup.txt && -d /etc/v2ray/233boy/v2ray ]]; then elif [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f /etc/v2ray/233blog_v2ray_backup.txt && -d /etc/v2ray/233boy/v2ray ]]; then
@ -112,6 +112,7 @@ transport=(
mKCP_srtp_dynamicPort mKCP_srtp_dynamicPort
mKCP_wechat-video_dynamicPort mKCP_wechat-video_dynamicPort
HTTP/2 HTTP/2
Socks5
) )
ciphers=( ciphers=(
@ -134,43 +135,32 @@ get_transport_args() {
case $v2ray_transport in case $v2ray_transport in
1 | 9) 1 | 9)
net="tcp" net="tcp"
# network="tcp"
# obfs="none"
;; ;;
2 | 10) 2 | 10)
net="tcp" net="tcp"
# network="tcp"
header="http" header="http"
host="www.baidu.com" host="www.baidu.com"
# obfs="http"
;; ;;
3 | 4 | 11) 3 | 4 | 11)
net="ws" net="ws"
# network="ws (WebSocket)"
# obfs="websocket"
;; ;;
5 | 12) 5 | 12)
net="kcp" net="kcp"
# network="kcp"
;; ;;
6 | 13) 6 | 13)
net="kcp" net="kcp"
# network="kcp"
header="utp" header="utp"
;; ;;
7 | 14) 7 | 14)
net="kcp" net="kcp"
# network="kcp"
header="srtp" header="srtp"
;; ;;
8 | 15) 8 | 15)
net="kcp" net="kcp"
# network="kcp"
header="wechat-video" header="wechat-video"
;; ;;
16) 16)
net="h2" net="h2"
# local network="h2"
;; ;;
esac esac
} }
@ -215,8 +205,8 @@ create_vmess_URL_config() {
} }
view_v2ray_config_info() { view_v2ray_config_info() {
get_transport_args [[ $v2ray_transport != 17 ]] && get_transport_args
[[ -z $ip ]] && get_ip
echo echo
echo echo
echo "---------- V2Ray 配置信息 -------------" echo "---------- V2Ray 配置信息 -------------"
@ -244,14 +234,25 @@ view_v2ray_config_info() {
echo echo
echo -e "$yellow TLS (Enable TLS) = ${cyan}打开$none" echo -e "$yellow TLS (Enable TLS) = ${cyan}打开$none"
echo echo
# echo -e " 请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) "
# echo
if [[ $is_blocked_ad ]]; then if [[ $is_blocked_ad ]]; then
echo " 备注: 广告拦截已开启.." echo " 备注: 广告拦截已开启.."
echo echo
fi fi
elif [[ $v2ray_transport == 17 ]]; then
echo
echo -e "$yellow 主机 (Hostname) = $cyan${ip}$none"
echo
echo -e "$yellow 端口 (Port) = $cyan$v2ray_port$none"
echo
echo -e "$yellow 用户名 (Username) = $cyan${username}$none"
echo
echo -e "$yellow 密码 (Password) = $cyan${userpass}$none"
echo
echo -e "$yellow Telegram 代理配置链接 = ${cyan}tg://socks?server=${ip}&port=${v2ray_port}&user=${username}&pass=${userpass}$none"
echo
echo " 这是 Socks5 协议相关的配置啦.... 不用在乎一些 V2Ray 客户端 怎么没有这些东东配置的"
echo
else else
[[ -z $ip ]] && get_ip
echo echo
echo -e "$yellow 地址 (Address) = $cyan${ip}$none" echo -e "$yellow 地址 (Address) = $cyan${ip}$none"
echo echo
@ -265,13 +266,6 @@ view_v2ray_config_info() {
echo echo
echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none" echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none"
echo echo
# if [[ $obfs ]]; then
# echo -e " 请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) "
# echo
# else
# echo -e " 帅帅的提示...此 V2Ray 配置不支持 Pepi / ShadowRay"
# echo
# fi
fi fi
if [[ $v2ray_transport -ge 9 && $v2ray_transport -le 15 ]] && [[ $is_blocked_ad ]]; then if [[ $v2ray_transport -ge 9 && $v2ray_transport -le 15 ]] && [[ $is_blocked_ad ]]; then
echo " 备注: 动态端口已启用...广告拦截已开启..." echo " 备注: 动态端口已启用...广告拦截已开启..."
@ -775,27 +769,31 @@ disable_shadowsocks() {
done done
} }
change_v2ray_config() { change_v2ray_config() {
local _menu=(
"修改 V2Ray 端口"
"修改 V2Ray 传输协议"
"修改 V2Ray 动态端口 (如果可以)"
"修改 用户ID ( UUID )"
"修改 TLS 域名 (如果可以)"
"修改 分流的路径 (如果可以)"
"修改 伪装的网址 (如果可以)"
"关闭 网站伪装 和 路径分流 (如果可以)"
"开启 / 关闭 广告拦截"
"修改 Socks5 用户名 (如果可以)"
"修改 Socks5 密码 (如果可以)"
)
while :; do while :; do
for ((i = 1; i <= ${#_menu[*]}; i++)); do
if [[ "$i" -le 9 ]]; then
echo echo
echo -e "$yellow 1. $none修改 V2Ray 端口" echo -e "$yellow $i. $none${_menu[$i - 1]}"
echo else
echo -e "$yellow 2. $none修改 V2Ray 传输协议"
echo
echo -e "$yellow 3. $none修改 V2Ray 动态端口 (如果可以)"
echo
echo -e "$yellow 4. $none修改 用户ID ( UUID )"
echo
echo -e "$yellow 5. $none修改 TLS 域名 (如果可以)"
echo
echo -e "$yellow 6. $none修改 分流的路径 (如果可以)"
echo
echo -e "$yellow 7. $none修改 伪装的网址 (如果可以)"
echo
echo -e "$yellow 8. $none关闭 网站伪装 和 路径分流 (如果可以)"
echo echo
echo -e "$yellow 9. $none开启 / 关闭 广告拦截" echo -e "$yellow $i. $none${_menu[$i - 1]}"
fi
done
echo echo
read -p "$(echo -e "请选择 [${magenta}1-9$none]:")" _opt read -p "$(echo -e "请选择 [${magenta}1-${#_menu[*]}$none]:")" _opt
if [[ -z $_opt ]]; then if [[ -z $_opt ]]; then
error error
else else
@ -836,6 +834,19 @@ change_v2ray_config() {
blocked_hosts blocked_hosts
break break
;; ;;
10)
change_socks_user_config
break
;;
11)
change_socks_pass_config
break
;;
[aA][Ii][aA][Ii] | [Dd][Dd])
socks_check
custom_uuid
break
;;
[Dd] | [Aa][Ii] | 233 | 233[Bb][Ll][Oo][Gg] | 233[Bb][Ll][Oo][Gg].[Cc][Oo][Mm] | 233[Bb][Oo][Yy] | [Aa][Ll][Tt][Ee][Rr][Ii][Dd]) [Dd] | [Aa][Ii] | 233 | 233[Bb][Ll][Oo][Gg] | 233[Bb][Ll][Oo][Gg].[Cc][Oo][Mm] | 233[Bb][Oo][Yy] | [Aa][Ll][Tt][Ee][Rr][Ii][Dd])
change_v2ray_alterId change_v2ray_alterId
break break
@ -1002,7 +1013,7 @@ change_v2ray_transport() {
break break
fi fi
;; ;;
[1-9] | 1[0-6]) [1-9] | 1[0-7])
echo echo
echo echo
echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport_opt - 1]}$none" echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport_opt - 1]}$none"
@ -1025,31 +1036,7 @@ change_v2ray_transport() {
v2ray_dynamic_port_start v2ray_dynamic_port_start
v2ray_dynamic_port_end v2ray_dynamic_port_end
pause pause
if [[ $v2ray_transport == 4 || $v2ray_transport == 16 ]]; then old_transport
del_port "80"
del_port "443"
if [[ $caddy_installed && $caddy_pid ]]; then
# systemctl stop caddy
do_service stop caddy
if [[ $systemd ]]; then
systemctl disable caddy >/dev/null 2>&1
else
update-rc.d -f caddy remove >/dev/null 2>&1
fi
elif [[ $caddy_installed ]]; then
if [[ $systemd ]]; then
systemctl disable caddy >/dev/null 2>&1
else
update-rc.d -f caddy remove >/dev/null 2>&1
fi
fi
if [[ $is_path ]]; then
# sed -i "41s/true/false/" $backup
backup_config -path
fi
elif [[ $v2ray_transport -ge 9 && $v2ray_transport -le 15 ]]; then
del_port "multiport"
fi
open_port "multiport" open_port "multiport"
backup_config v2ray_transport v2ray_dynamicPort_start v2ray_dynamicPort_end backup_config v2ray_transport v2ray_dynamicPort_start v2ray_dynamicPort_end
port_range="${v2ray_dynamic_port_start_input}-${v2ray_dynamic_port_end_input}" port_range="${v2ray_dynamic_port_start_input}-${v2ray_dynamic_port_end_input}"
@ -1058,14 +1045,35 @@ change_v2ray_transport() {
clear clear
view_v2ray_config_info view_v2ray_config_info
download_v2ray_config_ask download_v2ray_config_ask
elif [[ $v2ray_transport_opt == 17 ]]; then
socks_user_config
socks_pass_config
pause
old_transport
backup_config v2ray_transport username userpass
v2ray_transport=$v2ray_transport_opt
username=$new_username
userpass=$new_userpass
config
clear
view_v2ray_config_info
download_v2ray_config_ask
else else
# sed -i "17s/$v2ray_transport/$v2ray_transport_opt/" $backup old_transport
backup_config v2ray_transport backup_config v2ray_transport
v2ray_transport=$v2ray_transport_opt
config
clear
view_v2ray_config_info
download_v2ray_config_ask
fi
}
old_transport() {
if [[ $v2ray_transport == 4 || $v2ray_transport == 16 ]]; then if [[ $v2ray_transport == 4 || $v2ray_transport == 16 ]]; then
del_port "80" del_port "80"
del_port "443" del_port "443"
if [[ $caddy_installed && $caddy_pid ]]; then if [[ $caddy_installed && $caddy_pid ]]; then
# systemctl stop caddy
do_service stop caddy do_service stop caddy
if [[ $systemd ]]; then if [[ $systemd ]]; then
systemctl disable caddy >/dev/null 2>&1 systemctl disable caddy >/dev/null 2>&1
@ -1080,20 +1088,60 @@ change_v2ray_transport() {
fi fi
fi fi
if [[ $is_path ]]; then if [[ $is_path ]]; then
# sed -i "41s/true/false/" $backup
backup_config -path backup_config -path
fi fi
elif [[ $v2ray_transport -ge 9 && $v2ray_transport -le 15 ]]; then elif [[ $v2ray_transport -ge 9 && $v2ray_transport -le 15 ]]; then
del_port "multiport" del_port "multiport"
fi fi
v2ray_transport=$v2ray_transport_opt }
config
clear socks_user_config() {
view_v2ray_config_info echo
download_v2ray_config_ask while :; do
fi read -p "$(echo -e "请输入$yellow用户名$none...(默认用户名: ${cyan}233blog$none)"): " new_username
[ -z "$new_username" ] && new_username="233blog"
case $new_username in
*[/$]* | *\&*)
echo
echo -e " 由于这个脚本太辣鸡了..所以用户名不能包含$red / $none或$red $ $none或$red & $none这三个符号.... "
echo
error
;;
*)
echo
echo
echo -e "$yellow 用户名 = $cyan$new_username$none"
echo "----------------------------------------------------------------"
echo
break
;;
esac
done
} }
socks_pass_config() {
echo
while :; do
read -p "$(echo -e "请输入$yellow密码$none...(默认密码: ${cyan}233blog.com$none)"): " new_userpass
[ -z "$new_userpass" ] && new_userpass="233blog.com"
case $new_userpass in
*[/$]* | *\&*)
echo
echo -e " 由于这个脚本太辣鸡了..所以密码不能包含$red / $none或$red $ $none或$red & $none这三个符号.... "
echo
error
;;
*)
echo
echo
echo -e "$yellow 密码 = $cyan$new_userpass$none"
echo "----------------------------------------------------------------"
echo
break
;;
esac
done
}
tls_config() { tls_config() {
while :; do while :; do
@ -2150,6 +2198,148 @@ change_v2ray_alterId() {
esac esac
done done
} }
change_socks_user_config() {
if [[ $v2ray_transport == 17 ]]; then
echo
while :; do
read -p "$(echo -e "请输入$yellow用户名$none...(当前用户名: ${cyan}$username$none)"): " new_username
[ -z "$new_username" ] && error && continue
case $new_username in
$username)
echo
echo -e " 大佬...跟 当前用户名 一毛一样啊...修改个鸡鸡哦 "
echo
error
;;
*[/$]* | *\&*)
echo
echo -e " 由于这个脚本太辣鸡了..所以用户名不能包含$red / $none或$red $ $none或$red & $none这三个符号.... "
echo
error
;;
*)
echo
echo
echo -e "$yellow 用户名 = $cyan$new_username$none"
echo "----------------------------------------------------------------"
echo
pause
backup_config username
username=$new_username
config
clear
view_v2ray_config_info
download_v2ray_config_ask
break
;;
esac
done
else
echo
echo -e "$red 哎呀....不支持修改呢...$none"
echo
echo -e " 必须使用..${cyan} Socks5 $none传输协议才能修改哦"
echo
echo -e " 当前传输协议为: ${cyan}${transport[$v2ray_transport - 1]}${none}"
echo
fi
}
change_socks_pass_config() {
if [[ $v2ray_transport == 17 ]]; then
echo
while :; do
read -p "$(echo -e "请输入$yellow密码$none...(当前密码: ${cyan}$userpass$none)"): " new_userpass
[ -z "$new_userpass" ] && error && continue
case $new_userpass in
$userpass)
echo
echo -e " 大佬...跟 当前密码 一毛一样啊...修改个鸡鸡哦 "
echo
error
;;
*[/$]* | *\&*)
echo
echo -e " 由于这个脚本太辣鸡了..所以密码不能包含$red / $none或$red $ $none或$red & $none这三个符号.... "
echo
error
;;
*)
echo
echo
echo -e "$yellow 密码 = $cyan$new_userpass$none"
echo "----------------------------------------------------------------"
echo
pause
backup_config userpass
userpass=$new_userpass
config
clear
view_v2ray_config_info
download_v2ray_config_ask
break
;;
esac
done
else
echo
echo -e "$red 哎呀....不支持修改呢...$none"
echo
echo -e " 必须使用..${cyan} Socks5 $none传输协议才能修改哦"
echo
echo -e " 当前传输协议为: ${cyan}${transport[$v2ray_transport - 1]}${none}"
echo
fi
}
socks_check() {
if [[ $v2ray_transport == 17 ]]; then
echo
echo -e " 哎呀...由于你当前使用 Socks5 传输协议...是无法执行此功能的哦.."
echo
echo -e " 如果你想要查看 Socks5 配置信息的话...请使用$cyan v2ray info $none"
echo
exit 1
fi
}
custom_uuid() {
echo
while :; do
echo -e "请输入$yello自定义的 UUID$none...(${cyan}UUID 格式一定要对!!!$none)"
read -p "$(echo -e "(当前 UUID: ${cyan}${v2ray_id}$none)"): " myuuid
[ -z "$myuuid" ] && error && continue
case $myuuid in
$v2ray_id)
echo
echo -e " 大佬...跟 当前 UUID 一毛一样啊...修改个鸡鸡哦 "
echo
error
;;
*[/$]* | *\&*)
echo
echo -e " 由于这个脚本太辣鸡了..所以 UUID 不能包含$red / $none或$red $ $none或$red & $none这三个符号.... "
echo
error
;;
*)
echo
echo
echo -e "$yellow UUID = $cyan$myuuid$none"
echo
echo -e " 如果 UUID 格式不正确.. V2Ray 会跪...使用$cyan v2ray reuuid$none 复活"
echo "----------------------------------------------------------------"
echo
pause
uuid=$myuuid
backup_config uuid
v2ray_id=$uuid
config
clear
view_v2ray_config_info
download_v2ray_config_ask
break
;;
esac
done
}
v2ray_service() { v2ray_service() {
while :; do while :; do
echo echo
@ -2339,7 +2529,6 @@ get_v2ray_config_link() {
echo -e "$green 正在生成链接.... 稍等片刻即可....$none" echo -e "$green 正在生成链接.... 稍等片刻即可....$none"
echo echo
local random=$(echo $RANDOM-$RANDOM-$RANDOM | base64) local random=$(echo $RANDOM-$RANDOM-$RANDOM | base64)
# local link=$(curl -s --upload-file /etc/v2ray/233blog_v2ray.zip "https://transfer.sh/${random}_233blog_v2ray.zip")
local link=$(curl -s --upload-file $v2ray_client_config "https://transfer.sh/${random}_233blog_v2ray.json") local link=$(curl -s --upload-file $v2ray_client_config "https://transfer.sh/${random}_233blog_v2ray.json")
if [[ $link ]]; then if [[ $link ]]; then
echo echo
@ -2347,8 +2536,6 @@ get_v2ray_config_link() {
echo echo
echo -e "$yellow 链接 = $cyan$link$none" echo -e "$yellow 链接 = $cyan$link$none"
echo echo
# echo -e "$yellow 解压密码 = ${cyan}233blog.com$none"
# echo
echo -e "$yellow SOCKS 监听端口 = ${cyan}2333${none}" echo -e "$yellow SOCKS 监听端口 = ${cyan}2333${none}"
echo echo
echo -e "${yellow} HTTP 监听端口 = ${cyan}6666$none" echo -e "${yellow} HTTP 监听端口 = ${cyan}6666$none"
@ -2396,8 +2583,6 @@ create_v2ray_config_text() {
echo echo
echo "TLS (Enable TLS) = 打开" echo "TLS (Enable TLS) = 打开"
echo echo
# echo -e " 请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) "
# echo
if [[ $is_blocked_ad ]]; then if [[ $is_blocked_ad ]]; then
echo " 备注: 广告拦截已开启.." echo " 备注: 广告拦截已开启.."
echo echo
@ -2417,13 +2602,6 @@ create_v2ray_config_text() {
echo echo
echo "伪装类型 (header type) = ${header}" echo "伪装类型 (header type) = ${header}"
echo echo
# if [[ $obfs ]]; then
# echo -e "请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) "
# echo
# else
# echo -e "帅帅的提示...此 V2Ray 配置不支持 Pepi / ShadowRay"
# echo
# fi
fi fi
if [[ $v2ray_transport -ge 9 || $v2ray_transport -le 15 ]] && [[ $is_blocked_ad ]]; then if [[ $v2ray_transport -ge 9 || $v2ray_transport -le 15 ]] && [[ $is_blocked_ad ]]; then
echo "备注: 动态端口已启用...广告拦截已开启..." echo "备注: 动态端口已启用...广告拦截已开启..."
@ -2441,6 +2619,7 @@ create_v2ray_config_text() {
echo echo
} }
get_v2ray_config_info_link() { get_v2ray_config_info_link() {
socks_check
echo echo
echo -e "$green 正在生成链接.... 稍等片刻即可....$none" echo -e "$green 正在生成链接.... 稍等片刻即可....$none"
echo echo
@ -2468,29 +2647,12 @@ get_v2ray_config_info_link() {
} }
get_v2ray_config_qr_link() { get_v2ray_config_qr_link() {
socks_check
create_vmess_URL_config create_vmess_URL_config
# if [[ $obfs ]]; then
# if [[ $v2ray_transport == 4 ]]; then
# ip_or_domain=$domain
# else
# ip_or_domain=$ip
# fi
# local shadowray_qr="vmess://$(echo -n "aes-128-cfb:${v2ray_id}@${ip_or_domain}:${v2ray_port}" | base64)?remarks=233blog_v2ray_${ip_or_domain}&obfs=${obfs}"
# echo "${shadowray_qr}" >/etc/v2ray/shadowray_qr.txt
# sed -i 'N;s/\n//' /etc/v2ray/shadowray_qr.txt
# fi
echo echo
echo -e "$green 正在生成链接.... 稍等片刻即可....$none" echo -e "$green 正在生成链接.... 稍等片刻即可....$none"
echo echo
# case $v2ray_transport in
# [1-4] | 9 | 10 | 11)
# local ios_qr=true
# local random3=$(echo $RANDOM-$RANDOM-$RANDOM | base64)
# cat /etc/v2ray/shadowray_qr.txt | qrencode -s 50 -o /tmp/233blog_shadowray_qr.png
# local link3=$(curl -s --upload-file /tmp/233blog_shadowray_qr.png "https://transfer.sh/${random3}_233blog_v2ray.png")
# ;;
# esac
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)" local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)"
echo $vmess >/etc/v2ray/vmess.txt echo $vmess >/etc/v2ray/vmess.txt
cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png
@ -2502,19 +2664,6 @@ get_v2ray_config_qr_link() {
echo echo
echo -e "$yellow 适用于 V2RayNG v0.4.1+ / Kitsunebi = $cyan$link$none" echo -e "$yellow 适用于 V2RayNG v0.4.1+ / Kitsunebi = $cyan$link$none"
echo echo
# if [[ $ios_qr && $link3 ]]; then
# echo -e "$yellow 适用于 Pepi / ShadowRay = $cyan${link3}$none"
# echo
# echo " 请在 Pepi / ShadowRay 配置界面将 Alter Id 设置为 ${alterId} (如果你使用 Pepi / ShadowRay)"
# if [[ $v2ray_transport == 4 ]]; then
# echo
# echo " 请在 Pepi / ShadowRay 配置界面打开 TLS (Enable TLS) (如果你使用 Pepi / ShadowRay)"
# fi
# elif [[ $ios_qr ]]; then
# echo -e "$red 生成适用于 Pepi / ShadowRay 的二维码链接 出错.... $none 请尝试使用${cyan} v2ray qr ${none}重新生成"
# else
# echo -e "$red 帅帅的提示...此 V2Ray 配置不支持 Pepi / ShadowRay...$none"
# fi
echo echo
echo " V2Ray 客户端使用教程: https://233blog.com/post/20/" echo " V2Ray 客户端使用教程: https://233blog.com/post/20/"
echo echo
@ -2532,12 +2681,9 @@ get_v2ray_config_qr_link() {
rm -rf /tmp/233blog_v2ray.png rm -rf /tmp/233blog_v2ray.png
rm -rf /etc/v2ray/vmess_qr.json rm -rf /etc/v2ray/vmess_qr.json
rm -rf /etc/v2ray/vmess.txt rm -rf /etc/v2ray/vmess.txt
# if [[ $ios_qr ]]; then
# rm -rf /tmp/233blog_shadowray_qr.png
# rm -rf /etc/v2ray/shadowray_qr.txt
# fi
} }
get_v2ray_vmess_URL_link() { get_v2ray_vmess_URL_link() {
socks_check
create_vmess_URL_config create_vmess_URL_config
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)" local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)"
echo echo
@ -2987,6 +3133,10 @@ config() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/h2_ss.json" v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/h2_ss.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json" v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json"
;; ;;
17)
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/socks_ss.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/socks.json"
;;
esac esac
else else
case $v2ray_transport in case $v2ray_transport in
@ -3030,6 +3180,10 @@ config() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/h2_ss.json" v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/h2_ss.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json" v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json"
;; ;;
17)
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/socks_ss.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/socks.json"
;;
esac esac
fi fi
else else
@ -3075,6 +3229,10 @@ config() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/h2.json" v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/h2.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json" v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json"
;; ;;
17)
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/socks.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/socks.json"
;;
esac esac
else else
case $v2ray_transport in case $v2ray_transport in
@ -3118,6 +3276,10 @@ config() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/h2.json" v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/h2.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json" v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json"
;; ;;
17)
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/socks.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/socks.json"
;;
esac esac
fi fi
@ -3152,6 +3314,9 @@ config() {
16) 16)
sed -i "46s/6666/$ssport/; 48s/chacha20-ietf/$ssciphers/; 49s/233blog.com/$sspass/" $v2ray_server_config sed -i "46s/6666/$ssport/; 48s/chacha20-ietf/$ssciphers/; 49s/233blog.com/$sspass/" $v2ray_server_config
;; ;;
17)
sed -i "30s/6666/$ssport/; 32s/chacha20-ietf/$ssciphers/; 33s/233blog.com/$sspass/" $v2ray_server_config
;;
esac esac
case $v2ray_transport in case $v2ray_transport in
@ -3223,8 +3388,11 @@ config() {
fi fi
if [[ $v2ray_transport == 17 ]]; then
sed -i "8s/2333/$v2ray_port/; 14s/233blog/$username/; 15s/233blog.com/$userpass/" $v2ray_server_config
else
sed -i "8s/2333/$v2ray_port/; 14s/$old_id/$v2ray_id/; 16s/233/$alterId/" $v2ray_server_config sed -i "8s/2333/$v2ray_port/; 14s/$old_id/$v2ray_id/; 16s/233/$alterId/" $v2ray_server_config
fi
if [[ $v2ray_transport -eq 16 ]]; then if [[ $v2ray_transport -eq 16 ]]; then
sed -i "24s/233blog.com/$domain/" $v2ray_server_config sed -i "24s/233blog.com/$domain/" $v2ray_server_config
if [[ $is_path ]]; then if [[ $is_path ]]; then
@ -3234,6 +3402,7 @@ config() {
fi fi
fi fi
[[ -z $ip ]] && get_ip
if [[ $v2ray_transport -eq 4 || $v2ray_transport -eq 16 ]]; then if [[ $v2ray_transport -eq 4 || $v2ray_transport -eq 16 ]]; then
sed -i "s/233blog.com/$domain/; 22s/2333/443/; 25s/$old_id/$v2ray_id/; 26s/233/$alterId/" $v2ray_client_config sed -i "s/233blog.com/$domain/; 22s/2333/443/; 25s/$old_id/$v2ray_id/; 26s/233/$alterId/" $v2ray_client_config
if [[ $is_path ]]; then if [[ $is_path ]]; then
@ -3241,8 +3410,9 @@ config() {
else else
sed -i "40s/233blog//" $v2ray_client_config sed -i "40s/233blog//" $v2ray_client_config
fi fi
elif [[ $v2ray_transport == 17 ]]; then
sed -i "21s/233blog.com/$ip/; 22s/2333/$v2ray_port/; 25s/233blog/$username/; 26s/233blog.com/$userpass/" $v2ray_client_config
else else
[[ -z $ip ]] && get_ip
sed -i "s/233blog.com/$ip/; 22s/2333/$v2ray_port/; 25s/$old_id/$v2ray_id/; 26s/233/$alterId/" $v2ray_client_config sed -i "s/233blog.com/$ip/; 22s/2333/$v2ray_port/; 25s/$old_id/$v2ray_id/; 26s/233/$alterId/" $v2ray_client_config
fi fi
@ -3319,6 +3489,12 @@ backup_config() {
proxy_site) proxy_site)
sed -i "63s#=$proxy_site#=$new_proxy_site#" $backup sed -i "63s#=$proxy_site#=$new_proxy_site#" $backup
;; ;;
username)
sed -i "66s/=$username/=$new_username/" $backup
;;
userpass)
sed -i "69s/=$userpass/=$new_userpass/" $backup
;;
esac esac
done done
@ -3332,24 +3508,6 @@ _boom_() {
create_vmess_URL_config create_vmess_URL_config
# if [[ $obfs ]]; then
# if [[ $v2ray_transport == 4 ]]; then
# ip_or_domain=$domain
# else
# ip_or_domain=$ip
# fi
# local shadowray_qr="vmess://$(echo -n "aes-128-cfb:${v2ray_id}@${ip_or_domain}:${v2ray_port}" | base64)?remarks=233blog_v2ray_${ip_or_domain}&obfs=${obfs}"
# echo "${shadowray_qr}" >/etc/v2ray/shadowray_qr.txt
# sed -i 'N;s/\n//' /etc/v2ray/shadowray_qr.txt
# fi
# case $v2ray_transport in
# [1-4] | 9 | 10 | 11)
# local ios_qr=true
# local random=$(echo $RANDOM-$RANDOM-$RANDOM | base64)
# cat /etc/v2ray/shadowray_qr.txt | qrencode -s 50 -o /tmp/233blog_shadowray_qr.png
# local link=$(curl -s --upload-file /tmp/233blog_shadowray_qr.png "https://transfer.sh/${random}_233blog_v2ray.png")
# ;;
# esac
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)" local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)"
echo $vmess >/etc/v2ray/vmess.txt echo $vmess >/etc/v2ray/vmess.txt
cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png cat /etc/v2ray/vmess.txt | qrencode -s 50 -o /tmp/233blog_v2ray.png
@ -3357,7 +3515,6 @@ _boom_() {
local random1=$(echo $RANDOM-$RANDOM-$RANDOM | base64) local random1=$(echo $RANDOM-$RANDOM-$RANDOM | base64)
local random2=$(echo $RANDOM-$RANDOM-$RANDOM | base64) local random2=$(echo $RANDOM-$RANDOM-$RANDOM | base64)
local random3=$(echo $RANDOM-$RANDOM-$RANDOM | base64) local random3=$(echo $RANDOM-$RANDOM-$RANDOM | base64)
# local link1=$(curl -s --upload-file /etc/v2ray/233blog_v2ray.zip "https://transfer.sh/${random1}_233blog_v2ray.zip")
local link1=$(curl -s --upload-file $v2ray_client_config "https://transfer.sh/${random1}_233blog_v2ray.json") local link1=$(curl -s --upload-file $v2ray_client_config "https://transfer.sh/${random1}_233blog_v2ray.json")
local link2=$(curl -s --upload-file /tmp/233blog_v2ray.txt "https://transfer.sh/${random2}_233blog_v2ray.txt") local link2=$(curl -s --upload-file /tmp/233blog_v2ray.txt "https://transfer.sh/${random2}_233blog_v2ray.txt")
local link3=$(curl -s --upload-file /tmp/233blog_v2ray.png "https://transfer.sh/${random3}_233blog_v2ray.png") local link3=$(curl -s --upload-file /tmp/233blog_v2ray.png "https://transfer.sh/${random3}_233blog_v2ray.png")
@ -3369,8 +3526,6 @@ _boom_() {
echo echo
echo -e "$yellow V2RayNG v0.4.1+ / Kitsunebi 二维码链接: $cyan$link3$none" echo -e "$yellow V2RayNG v0.4.1+ / Kitsunebi 二维码链接: $cyan$link3$none"
echo echo
# echo -e "$yellow Pepi / ShadowRay 二维码链接: $cyan$link$none"
# echo
echo "V2Ray 客户端使用教程: https://233blog.com/post/20/" echo "V2Ray 客户端使用教程: https://233blog.com/post/20/"
echo echo
else else
@ -3380,8 +3535,6 @@ _boom_() {
fi fi
rm -rf /tmp/233blog_v2ray.txt rm -rf /tmp/233blog_v2ray.txt
rm -rf /etc/v2ray/vmess_qr.json rm -rf /etc/v2ray/vmess_qr.json
# rm -rf /etc/v2ray/shadowray_qr.txt
# rm -rf /tmp/233blog_shadowray_qr.png
rm -rf /etc/v2ray/vmess.txt rm -rf /etc/v2ray/vmess.txt
rm -rf /tmp/233blog_v2ray.png rm -rf /tmp/233blog_v2ray.png
@ -3609,16 +3762,32 @@ un | uninstall)
reinstall) reinstall)
uninstall_v2ray uninstall_v2ray
if [[ $is_uninstall_v2ray ]]; then if [[ $is_uninstall_v2ray ]]; then
cd; cd - >/dev/null 2>&1 cd
cd - >/dev/null 2>&1
bash <(curl -s -L https://233blog.com/v2ray.sh) bash <(curl -s -L https://233blog.com/v2ray.sh)
fi fi
;; ;;
233 | 2333 | 233boy | 233blog | 233blog.com) 233 | 2333 | 233boy | 233blog | 233blog.com)
socks_check
_boom_ _boom_
;; ;;
[aA][Ii] | [Dd]) [aA][Ii] | [Dd])
socks_check
change_v2ray_alterId change_v2ray_alterId
;; ;;
[aA][Ii][aA][Ii] | [Dd][Dd])
socks_check
custom_uuid
;;
reuuid)
socks_check
backup_config uuid
v2ray_id=$uuid
config
clear
view_v2ray_config_info
download_v2ray_config_ask
;;
v | version) v | version)
echo echo
echo -e " 当前 V2Ray 版本: ${green}$v2ray_ver$none / 当前 V2Ray 管理脚本版本: ${cyan}$_version$none" echo -e " 当前 V2Ray 版本: ${green}$v2ray_ver$none / 当前 V2Ray 管理脚本版本: ${cyan}$_version$none"

Loading…
Cancel
Save