pull/29/head v2.14
233boy 7 years ago
parent 18148145ca
commit 90a1e2be7c
  1. 19
      config/233blog.com.cer
  2. 27
      config/233blog.com.key
  3. 4
      config/backup.conf
  4. 13231
      config/blocked_hosts/server/h2.json
  5. 13244
      config/blocked_hosts/server/h2_ss.json
  6. 7
      config/client/h2.json
  7. 1
      config/client/ws_tls.json
  8. 78
      config/server/h2.json
  9. 91
      config/server/h2_ss.json
  10. 407
      install.sh
  11. 67
      tools/support_h2.sh
  12. 1430
      v2ray.sh

@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDFzCCAf+gAwIBAgIQVeM+8iZUKrI+M9rkL41DjjANBgkqhkiG9w0BAQsFADAf
MQswCQYDVQQKEwJBSTEQMA4GA1UEAxMHMjMzQmxvZzAgFw0xODA1MDExMDIwMjFa
GA8yMjg0MDcwNzE2MjAyMVowHzELMAkGA1UEChMCQUkxEDAOBgNVBAMTBzIzM0Js
b2cwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDn4tPOuedCbB6kerwg
5PSU9tdmGvQc2jVh9xXDfBjSknKkjZoylJ1+IFLRhxl3RtYBgN1xFLhVVOnqpprA
KqTbDomsk59+iktmNzZW2b5HuIi3onZ9jxtcwos+rvILrJPgcjX/4qCki/4QWekR
aY6LOSuRGqEbIq9Yqqd4/PzLWh1q2pgv2qwwKZlkQTnTj8xs1rlEE7wd/2ibmaHR
FgcvRw04TEFUbRRevC7gcyesB8dpfZX1c2OUKtUHp0z0CHF2Tby5g52FAti4YJag
HSQmOssCz8JLOhZ9fVp2cuwrDZc2sOn/Jl22ZJHHwNU142HkcuBTye/aAnl0SM3f
/vGTAgMBAAGjTTBLMA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcD
ATAMBgNVHRMBAf8EAjAAMBYGA1UdEQQPMA2CCzIzM2Jsb2cuY29tMA0GCSqGSIb3
DQEBCwUAA4IBAQCmyLW3R2Je30zEbMObtjF2oNNj7ELH+bLgRXUIlCzjMcYB9m7d
K+2ntfK5iA6tNV2Q4timcSxls15wxPd59oI76ShXA/jSV08fRaq7drDQsOy/jGyn
pU1PiQKEDj7dJOLgPWlNZM3cAkretn+owWtY2JIjrVrU8OA9anGes3nT2egrXmHR
B+6YPvl+WtPkFIpf+dBJxtIvvJEg0of6HDQvsQfXDIgCQzUHcRt0jtRejK1WzSLf
CVjs6H4GFRCr74dC3ovGyQqOznOK0m3QRYUNonQG9s1EAMJ2XBflq5/tqbx9Ef/o
CwOT+fjKVhMnbvMN4yCkJeJyDIPdWvHOdawk
-----END CERTIFICATE-----

@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA5+LTzrnnQmwepHq8IOT0lPbXZhr0HNo1YfcVw3wY0pJypI2a
MpSdfiBS0YcZd0bWAYDdcRS4VVTp6qaawCqk2w6JrJOffopLZjc2Vtm+R7iIt6J2
fY8bXMKLPq7yC6yT4HI1/+KgpIv+EFnpEWmOizkrkRqhGyKvWKqnePz8y1odatqY
L9qsMCmZZEE504/MbNa5RBO8Hf9om5mh0RYHL0cNOExBVG0UXrwu4HMnrAfHaX2V
9XNjlCrVB6dM9Ahxdk28uYOdhQLYuGCWoB0kJjrLAs/CSzoWfX1adnLsKw2XNrDp
/yZdtmSRx8DVNeNh5HLgU8nv2gJ5dEjN3/7xkwIDAQABAoIBAEqvb/DBR47JLAVl
0nn1xCDGcBHe1IkGbvMilcvkiEoqCOqfAO8RlrgsyP/bN4SHOB471xa4ybYSJ1UA
XA9QrNAxGn6O/WvQNwCw/7txXivTb5VVqjw+f12c+yQxTJwd9XLw1huYbo0Q2b+C
deK50MNeon2VyhXnUfqI3G/Ha9RCkP1kLXUJY5cU/BCHtY/tBxcgxeAqHp39h92Z
6yqJcZ7zcu+UUrQPbn3Oo8+rohKLz1crIfe3EEH72OO9LkaAA8nXeA06bKqaoZjP
o+KF6Mb7E67JBlalpadWIYUEj7lGmUU22kP57T6YNF/2E1PyPNHCyO5PoUzGgTFV
G+cCCuECgYEA7RHo8cdsZZdIPYc1sBu9qfhxNezdElzT4qfjJ1sibD7rtO6ZVS/9
eqRj8H0KSQzERQ9G8OuiBvcmzjo2VNiSCT/9wRIH7TrvAxcnCFdOI5k+W5XAYxoz
BoxdfB3KziTLlcOSLFU8ID5BjbkwBiIbZ+RZ4MhPGOHcQokvspWiUiUCgYEA+mbz
KvpF5+Uu8Mc3nEEUXa+6l3ZC85bRH0MCS0CtdFF3N3Tuteaa8IzTiumy4OAy8Y4j
57VYX0TRosZhwqaFFB4dHnpJvxK7u8eI3Xqb7VQ6c0jQDK0GhmWz0i4WCZQUeFsa
3b6goclgo5y5z31G08XKYB6o4foLK1NrnHpEu1cCgYB7h1qPKW/VG9gbn2mdQ0c3
2un6xFqJZ+9MaljVuAoex0aAt9cT6Xa2QhSFSlJisBFRPt2jSdTatkv1J6YJ3fNy
eHKb+O5CcfP680R2dy+TIxW4GTbvLMarwdYwh0GW2ttuRULUcPFsh6QW2gkpGPqY
zwb6NsXoXEAuN1ewQYIcNQKBgQCrtpmeqU3y/lk4SIU8I+zhajac0z6KaKwzsfIK
xOmt0IfegdOI7gDmYMxYgHZoe5azy3OX2+YkPr87zqsPnr231AbH9bhIzYHr/aM/
rmrrT01d7VqutqC43Vl5Ep2OJ/v5pRBBbA4fpEcfK8TIIvLFGufzDlNl0+CA743m
GnqztQKBgGxqQTInnvP8AHF7eu5L7gMs3gSrZbaSB4e6Hb9qaMdru9sOiHTmtKFc
P5z1pGgKWAN7VYF2ZLzJ+NYxJn63R9mkH0PuPzh8j+0Wdkpe2msVCIuZ/wm3Iv7f
VkFaQ64OitX/HpifTmh+dUaOWJ7GjW1PyDWjdPxViPdB+DQcDXFV
-----END RSA PRIVATE KEY-----

@ -54,10 +54,10 @@ ssciphers=chacha20-ietf
blocked_ad_status=
#---- 网站伪装 -----
ws_path_status=
path_status=
#---- 伪装的路径 -----
ws_path=233blog
path=233blog
#---- 伪装的网址 -----
proxy_site=https://liyafly.com

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -33,11 +33,10 @@
"streamSettings": {
"network": "h2",
"security": "tls",
"tlsSettings": {
"serverName": "233blog.com",
"allowInsecure": false
},
"httpSettings": {
"host": [
"233blog.com"
],
"path": "/233blog"
}
},

@ -35,7 +35,6 @@
"security": "tls",
"tlsSettings": {
"serverName": "233blog.com",
"allowInsecure": false
},
"wsSettings": {
"path": "/233blog"

@ -0,0 +1,78 @@
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"port": 2333,
"protocol": "vmess",
"settings": {
"udp": true,
"clients": [
{
"id": "23332333-2333-2333-2333-233boy233boy",
"level": 1,
"alterId": 233
}
]
},
"streamSettings": {
"network": "h2",
"httpSettings": {
"host": [
"233blog.com"
],
"path": "/233blog"
},
"security": "tls",
"tlsSettings": {
"certificates": [
{
"certificateFile": "/etc/v2ray/233boy/v2ray/config/233blog.com.cer",
"keyFile": "/etc/v2ray/233boy/v2ray/config/233blog.com.key"
}
]
}
}
},
"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,91 @@
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"port": 2333,
"protocol": "vmess",
"settings": {
"udp": true,
"clients": [
{
"id": "23332333-2333-2333-2333-233boy233boy",
"level": 1,
"alterId": 233
}
]
},
"streamSettings": {
"network": "h2",
"httpSettings": {
"host": [
"233blog.com"
],
"path": "/233blog"
},
"security": "tls",
"tlsSettings": {
"certificates": [
{
"certificateFile": "/etc/v2ray/233boy/v2ray/config/233blog.com.cer",
"keyFile": "/etc/v2ray/233boy/v2ray/config/233blog.com.key"
}
]
}
}
},
"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"
}
]
}
}
}

@ -62,6 +62,7 @@ transport=(
mKCP_utp_dynamicPort
mKCP_srtp_dynamicPort
mKCP_wechat-video_dynamicPort
HTTP/2
)
ciphers=(
@ -97,7 +98,7 @@ v2ray_config() {
read -p "$(echo -e "(默认协议: ${cyan}TCP$none)"):" v2ray_transport_opt
[ -z "$v2ray_transport_opt" ] && v2ray_transport_opt=1
case $v2ray_transport_opt in
[1-9] | 1[0-5])
[1-9] | 1[0-6])
echo
echo
echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport_opt - 1]}$none"
@ -113,7 +114,8 @@ v2ray_config() {
v2ray_port_config
}
v2ray_port_config() {
if [[ $v2ray_transport_opt -ne 4 && $v2ray_transport_opt -lt 9 ]]; then
case $v2ray_transport_opt in
[1-3] | [5-9] | 1[0-5])
local random=$(shuf -i20001-65535 -n1)
while :; do
echo -e "请输入 "$yellow"V2Ray"$none" 端口 ["$magenta"1-65535"$none"]"
@ -133,42 +135,14 @@ v2ray_port_config() {
;;
esac
done
elif [[ $v2ray_transport_opt -ge 9 ]]; then
v2ray_dynamic_port_config
else
ws_config
fi
}
v2ray_dynamic_port_config() {
echo
local random=$(shuf -i20001-65535 -n1)
while :; do
echo -e "请输入 "$yellow"V2Ray"$none" 端口 ["$magenta"1-65535"$none"]"
read -p "$(echo -e "(默认端口: ${cyan}${random}$none):")" v2ray_port
[ -z "$v2ray_port" ] && v2ray_port=$random
case $v2ray_port in
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
echo
echo
echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none"
echo "----------------------------------------------------------------"
echo
break
;;
*)
error
;;
esac
done
v2ray_dynamic_port_start
if [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]]; then
v2ray_dynamic_port_start
fi
;;
*)
tls_config
;;
esac
}
v2ray_dynamic_port_start() {
@ -239,7 +213,7 @@ v2ray_dynamic_port_end() {
}
ws_config() {
tls_config() {
echo
local random=$(shuf -i20001-65535 -n1)
@ -314,6 +288,18 @@ ws_config() {
done
if [[ $v2ray_transport_opt -ne 16 ]]; then
auto_tls_config
else
caddy=true
install_caddy_info="打开"
fi
if [[ $caddy ]]; then
path_config_ask
fi
}
auto_tls_config() {
echo -e "
安装 Caddy 来实现 自动配置 TLS
@ -356,20 +342,17 @@ ws_config() {
fi
done
if [[ $caddy ]]; then
ws_path_config_ask
fi
}
ws_path_config_ask() {
path_config_ask() {
echo
while :; do
echo -e "是否开启 网站伪装 和 路径分流 [${magenta}Y/N$none]"
read -p "$(echo -e "(默认: [${cyan}N$none]):")" is_ws_path
[[ -z $is_ws_path ]] && is_ws_path="n"
read -p "$(echo -e "(默认: [${cyan}N$none]):")" is_path
[[ -z $is_path ]] && is_path="n"
case $is_ws_path in
case $is_path in
Y | y)
ws_path_config
path_config
break
;;
N | n)
@ -386,14 +369,14 @@ ws_path_config_ask() {
esac
done
}
ws_path_config() {
path_config() {
echo
while :; do
echo -e "请输入想要 ${magenta}用来分流的路径$none , 例如 /233blog , 那么只需要输入 233blog 即可"
read -p "$(echo -e "(默认: [${cyan}233blog$none]):")" ws_path
[[ -z $ws_path ]] && ws_path="233blog"
read -p "$(echo -e "(默认: [${cyan}233blog$none]):")" path
[[ -z $path ]] && path="233blog"
case $ws_path in
case $path in
*[/$]*)
echo
echo -e " 由于这个脚本太辣鸡了..所以分流的路径不能包含$red / $none或$red $ $none这两个符号.... "
@ -403,7 +386,7 @@ ws_path_config() {
*)
echo
echo
echo -e "$yellow 分流的路径 = ${cyan}/${ws_path}$none"
echo -e "$yellow 分流的路径 = ${cyan}/${path}$none"
echo "----------------------------------------------------------------"
echo
break
@ -511,9 +494,12 @@ shadowsocks_port_config() {
error
;;
[1-9] | [1-9][0-9] | [1-9][0-9][0-9] | [1-9][0-9][0-9][0-9] | [1-5][0-9][0-9][0-9][0-9] | 6[0-4][0-9][0-9][0-9] | 65[0-4][0-9][0-9] | 655[0-3][0-5])
if [[ $v2ray_transport_opt == "4" && $ssport == "80" ]] || [[ $v2ray_transport_opt == "4" && $ssport == "443" ]]; then
if [[ $v2ray_transport_opt == "4" || $v2ray_transport_opt == "16" ]]; then
local tls=ture
fi
if [[ $tls && $ssport == "80" ]] || [[ $tls && $ssport == "443" ]]; then
echo
echo -e "由于你选择了 "$green"WebSocket + TLS"$none" 传输协议."
echo -e "由于你选择了 "$green"WebSocket + TLS $none或$green HTTP/2"$none" 传输协议."
echo
echo -e "所以不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
error
@ -612,7 +598,7 @@ install_info() {
echo
echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport_opt - 1]}$none"
if [[ $v2ray_transport_opt == "4" ]]; then
if [[ $v2ray_transport_opt == "4" || $v2ray_transport_opt == 16 ]]; then
echo
echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none"
echo
@ -626,11 +612,11 @@ install_info() {
echo
echo -e "$yellow 广告拦截 = $cyan$blocked_ad_info$none"
fi
if [[ $ws_path ]]; then
if [[ $path ]]; then
echo
echo -e "$yellow 路径分流 = ${cyan}/${ws_path}$none"
echo -e "$yellow 路径分流 = ${cyan}/${path}$none"
fi
elif [[ $v2ray_transport_opt -ge 9 ]]; then
elif [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]]; then
echo
echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none"
echo
@ -740,23 +726,25 @@ install_caddy() {
}
caddy_config() {
local email=$(shuf -i1-10000000000 -n1)
if [[ $ws_path ]]; then
cat >/etc/caddy/Caddyfile <<-EOF
case $v2ray_transport_opt in
4)
if [[ $path ]]; then
cat >/etc/caddy/Caddyfile <<-EOF
$domain {
tls ${email}@gmail.com
gzip
timeouts none
proxy / $proxy_site {
without /${ws_path}
without /${path}
}
proxy /${ws_path} 127.0.0.1:${v2ray_port} {
without /${ws_path}
proxy /${path} 127.0.0.1:${v2ray_port} {
without /${path}
websocket
}
}
EOF
else
cat >/etc/caddy/Caddyfile <<-EOF
else
cat >/etc/caddy/Caddyfile <<-EOF
$domain {
tls ${email}@gmail.com
timeouts none
@ -765,7 +753,41 @@ $domain {
}
}
EOF
fi
fi
;;
16)
if [[ $path ]]; then
cat >/etc/caddy/Caddyfile <<-EOF
$domain {
tls ${email}@gmail.com
gzip
timeouts none
proxy / $proxy_site {
without /${path}
}
proxy /${path} https://127.0.0.1:${v2ray_port} {
header_upstream Host {host}
header_upstream X-Forwarded-Proto {scheme}
insecure_skip_verify
}
}
EOF
else
cat >/etc/caddy/Caddyfile <<-EOF
$domain {
tls ${email}@gmail.com
timeouts none
proxy / https://127.0.0.1:${v2ray_port} {
header_upstream Host {host}
header_upstream X-Forwarded-Proto {scheme}
insecure_skip_verify
}
}
EOF
fi
;;
esac
# systemctl restart caddy
do_service restart caddy
@ -874,6 +896,10 @@ install_v2ray() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/kcp_ss_dynamic.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json"
;;
16)
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"
;;
esac
else
case $v2ray_transport_opt in
@ -913,6 +939,10 @@ install_v2ray() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/kcp_ss_dynamic.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json"
;;
16)
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"
;;
esac
fi
else
@ -954,6 +984,10 @@ install_v2ray() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/kcp_dynamic.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json"
;;
16)
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"
;;
esac
else
case $v2ray_transport_opt in
@ -993,6 +1027,10 @@ install_v2ray() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/kcp_dynamic.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json"
;;
16)
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/h2.json"
v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json"
;;
esac
fi
@ -1106,10 +1144,12 @@ config() {
10)
sed -i "67s/6666/$ssport/; 69s/chacha20-ietf/$ssciphers/; 70s/233blog.com/$sspass/; 78s/10000-20000/$multi_port/" $v2ray_server_config
;;
*)
1[1-5])
sed -i "34s/6666/$ssport/; 36s/chacha20-ietf/$ssciphers/; 37s/233blog.com/$sspass/; 45s/10000-20000/$multi_port/" $v2ray_server_config
;;
16)
sed -i "46s/6666/$ssport/; 48s/chacha20-ietf/$ssciphers/; 49s/233blog.com/$sspass/" $v2ray_server_config
;;
esac
case $v2ray_transport_opt in
@ -1147,7 +1187,7 @@ config() {
10)
sed -i "67s/10000-20000/$multi_port/" $v2ray_server_config
;;
11 | 12 | 13 | 14 | 15)
1[1-5])
sed -i "34s/10000-20000/$multi_port/" $v2ray_server_config
;;
esac
@ -1183,18 +1223,27 @@ config() {
sed -i "8s/2333/$v2ray_port/; 14s/$old_id/$uuid/" $v2ray_server_config
if [[ $v2ray_transport_opt -eq 4 ]]; then
if [[ $v2ray_transport_opt -eq 16 ]]; then
sed -i "24s/233blog.com/$domain/" $v2ray_server_config
if [[ $path ]]; then
sed -i "26s/233blog/$path/" $v2ray_server_config
else
sed -i "26s/233blog//" $v2ray_server_config
fi
fi
if [[ $v2ray_transport_opt -eq 4 || $v2ray_transport_opt -eq 16 ]]; then
sed -i "s/233blog.com/$domain/; 22s/2333/443/; 25s/$old_id/$uuid/" $v2ray_client_config
if [[ $ws_path ]]; then
sed -i "41s/233blog/$ws_path/" $v2ray_client_config
if [[ $path ]]; then
sed -i "40s/233blog/$path/" $v2ray_client_config
else
sed -i "41s/233blog//" $v2ray_client_config
sed -i "40s/233blog//" $v2ray_client_config
fi
else
sed -i "s/233blog.com/$ip/; 22s/2333/$v2ray_port/; 25s/$old_id/$uuid/" $v2ray_client_config
fi
zip -q -r -j --password "233blog.com" /etc/v2ray/233blog_v2ray.zip $v2ray_client_config
# zip -q -r -j --password "233blog.com" /etc/v2ray/233blog_v2ray.zip $v2ray_client_config
if [[ $cmd == "apt-get" ]]; then
cat >/etc/network/if-pre-up.d/iptables <<-EOF
@ -1214,11 +1263,11 @@ config() {
fi
[ $shadowsocks ] && open_port $ssport
if [[ $v2ray_transport_opt == "4" ]]; then
if [[ $v2ray_transport_opt == "4" || $v2ray_transport_opt == 16 ]]; then
open_port "80"
open_port "443"
open_port $v2ray_port
elif [[ $v2ray_transport_opt -ge 9 ]]; then
elif [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]]; then
open_port $v2ray_port
open_port "multiport"
else
@ -1232,17 +1281,17 @@ config() {
backup_config() {
sed -i "18s/=1/=$v2ray_transport_opt/; 21s/=2333/=$v2ray_port/; 24s/=$old_id/=$uuid/" $backup
if [ $v2ray_transport_opt -ge 9 ]; then
if [ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]; then
sed -i "30s/=10000/=$v2ray_dynamic_port_start_input/; 33s/=20000/=$v2ray_dynamic_port_end_input/" $backup
fi
if [ $shadowsocks ]; then
sed -i "42s/=/=true/; 45s/=6666/=$ssport/; 48s/=233blog.com/=$sspass/; 51s/=chacha20-ietf/=$ssciphers/" $backup
fi
[ $v2ray_transport_opt == "4" ] && sed -i "36s/=233blog.com/=$domain/" $backup
[[ $v2ray_transport_opt == "4" || $v2ray_transport_opt == 16 ]] && sed -i "36s/=233blog.com/=$domain/" $backup
[ $caddy ] && sed -i "39s/=/=true/" $backup
[ $is_blocked_ad ] && sed -i "54s/=/=true/" $backup
if [[ $ws_path ]]; then
sed -i "57s/=/=true/; 60s/=233blog/=$ws_path/" $backup
if [[ $path ]]; then
sed -i "57s/=/=true/; 60s/=233blog/=$path/" $backup
sed -i "63s#=https://liyafly.com#=$proxy_site#" $backup
fi
@ -1286,8 +1335,8 @@ do_service() {
}
show_config_info() {
local header="none"
if [[ $ws_path ]]; then
local host="/$ws_path"
if [[ $path ]]; then
local host=$domain
else
local host=""
fi
@ -1295,44 +1344,49 @@ show_config_info() {
case $v2ray_transport_opt in
1 | 9)
local net="tcp"
local network="tcp"
local obfs="none"
# local network="tcp"
# local obfs="none"
;;
2 | 10)
local net="tcp"
local network="tcp"
# local network="tcp"
local header="http"
local host="www.baidu.com"
local obfs="http"
# local obfs="http"
;;
3 | 4 | 11)
local net="ws"
local network="ws (WebSocket)"
local obfs="websocket"
# local network="ws"
# local obfs="websocket"
;;
5 | 12)
local net="kcp"
local network="kcp"
# local network="kcp"
;;
6 | 13)
local net="kcp"
local network="kcp"
# local network="kcp"
local header="utp"
;;
7 | 14)
local net="kcp"
local network="kcp"
# local network="kcp"
local header="srtp"
;;
8 | 15)
local net="kcp"
local network="kcp"
# local network="kcp"
local header="wechat-video"
;;
16)
local net="h2"
# local network="h2"
;;
esac
if [[ $v2ray_transport_opt == "4" ]]; then
if [[ $v2ray_transport_opt == "4" || $v2ray_transport_opt == 16 ]]; then
cat >/etc/v2ray/vmess_qr.json <<-EOF
{
"v": "2",
"ps": "233blog_v2ray_${domain}",
"add": "${domain}",
"port": "443",
@ -1341,12 +1395,14 @@ show_config_info() {
"net": "${net}",
"type": "none",
"host": "${host}",
"path": "/$path",
"tls": "tls"
}
EOF
else
cat >/etc/v2ray/vmess_qr.json <<-EOF
{
"v": "2",
"ps": "233blog_v2ray_${ip}",
"add": "${ip}",
"port": "${v2ray_port}",
@ -1355,20 +1411,21 @@ show_config_info() {
"net": "${net}",
"type": "${header}",
"host": "${host}",
"path": "",
"tls": ""
}
EOF
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
# 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
echo
echo "---------- V2Ray 安装完成 -------------"
@ -1382,7 +1439,7 @@ show_config_info() {
echo
fi
echo "---------- V2Ray 配置信息 -------------"
if [[ $v2ray_transport_opt == "4" ]]; then
if [[ $v2ray_transport_opt == "4" || $v2ray_transport_opt == 16 ]]; then
echo
echo -e "$yellow 地址 (Address) = $cyan${domain}$none"
echo
@ -1392,18 +1449,20 @@ show_config_info() {
echo
echo -e "$yellow 额外ID (Alter Id) = ${cyan}233${none}"
echo
echo -e "$yellow 传输协议 (Network) = ${cyan}${network}$none"
echo -e "$yellow 传输协议 (Network) = ${cyan}${net}$none"
echo
echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none"
echo
if [[ $ws_path ]]; then
echo -e "$yellow WebSocket 路径 (WS path) = ${cyan}/${ws_path}$none"
echo -e "$yellow 伪装域名 (host) = ${cyan}${host}$none"
echo
if [[ $path ]]; then
echo -e "$yellow 路径 (path) = ${cyan}/${path}$none"
echo
fi
echo -e "$yellow TLS (Enable TLS) = ${cyan}打开$none"
echo
echo -e " 请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) "
echo
# echo -e " 请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) "
# echo
else
echo
@ -1419,18 +1478,18 @@ show_config_info() {
echo
echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none"
echo
if [[ $obfs ]]; then
echo -e " 请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) "
echo
else
echo -e " 帅帅的提示...此 V2Ray 配置不支持 Pepi / ShadowRay"
echo
fi
# if [[ $obfs ]]; then
# echo -e " 请将 Obfs 设置为 $obfs ...并忽略 传输协议... (如果你使用 Pepi / ShadowRay) "
# echo
# else
# echo -e " 帅帅的提示...此 V2Ray 配置不支持 Pepi / ShadowRay"
# echo
# fi
fi
if [[ $v2ray_transport_opt -ge 9 && $is_blocked_ad ]]; then
if [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]] && [[ $is_blocked_ad ]]; then
echo " 备注: 动态端口已启用...广告拦截已开启..."
echo
elif [[ $v2ray_transport_opt -ge 9 ]]; then
elif [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]]; then
echo " 备注: 动态端口已启用..."
echo
elif [[ $is_blocked_ad ]]; then
@ -1469,7 +1528,7 @@ create_qr_link_ask() {
break
elif [[ $y_n == [Nn] ]]; then
rm -rf /etc/v2ray/vmess_qr.json
rm -rf /etc/v2ray/shadowray_qr.txt
# rm -rf /etc/v2ray/shadowray_qr.txt
break
else
error
@ -1486,7 +1545,7 @@ create_qr_link_ask() {
break
elif [[ $y_n == [Nn] ]]; then
rm -rf /etc/v2ray/vmess_qr.json
rm -rf /etc/v2ray/shadowray_qr.txt
# rm -rf /etc/v2ray/shadowray_qr.txt
break
else
error
@ -1500,14 +1559,14 @@ get_qr_link() {
echo -e "$green 正在生成链接.... 稍等片刻即可....$none"
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
# 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
local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64)"
@ -1524,25 +1583,25 @@ get_qr_link() {
echo
echo "---------- V2Ray 二维码链接 -------------"
echo
echo -e "$yellow 适用于 V2RayNG / Kitsunebi = $cyan${link1}$none"
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 [[ $ws_path ]]; then
echo
echo -e "$yellow 记得要将 WebSocket 路径 (WS path) 设置为: ${cyan}/${ws_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 -e "$yellow 适用于 V2RayNG v0.4.1+ / Kitsunebi = $cyan${link1}$none"
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 "---------- Shadowsocks 二维码链接 -------------"
@ -1580,25 +1639,25 @@ get_qr_link() {
echo
echo "---------- V2Ray 二维码链接 -------------"
echo
echo -e "$yellow 适用于 V2RayNG / Kitsunebi = $cyan${link1}$none"
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 [[ $ws_path ]]; then
echo
echo -e "$yellow 记得要将 WebSocket 路径 (WS path) 设置为: ${cyan}/${ws_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 -e "$yellow 适用于 V2RayNG v0.4.1+ / Kitsunebi = $cyan${link1}$none"
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 "----------------------------------------------------------------"
@ -1618,10 +1677,10 @@ get_qr_link() {
rm -rf /tmp/233blog_v2ray.png
rm -rf /etc/v2ray/vmess_qr.json
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
# if [[ $ios_qr ]]; then
# rm -rf /tmp/233blog_shadowray_qr.png
# rm -rf /etc/v2ray/shadowray_qr.txt
# fi
}
install() {
@ -1730,11 +1789,11 @@ uninstall() {
del_port $ssport
fi
if [[ $v2ray_transport == "4" ]]; then
if [[ $v2ray_transport == "4" || $v2ray_transport == 16 ]]; then
del_port "80"
del_port "443"
del_port $v2ray_port
elif [[ $v2ray_transport -ge 9 ]]; then
elif [[ $v2ray_transport -ge 9 && $v2ray_transport -le 15 ]]; then
del_port $v2ray_port
del_port "multiport"
else
@ -1788,11 +1847,11 @@ uninstall() {
del_port $ssport
fi
if [[ $v2ray_transport == "4" ]]; then
if [[ $v2ray_transport == "4" || $v2ray_transport == 16 ]]; then
del_port "80"
del_port "443"
del_port $v2ray_port
elif [[ $v2ray_transport -ge 9 ]]; then
elif [[ $v2ray_transport -ge 9 && $v2ray_transport -le 15 ]]; then
del_port $v2ray_port
del_port "multiport"
else

@ -0,0 +1,67 @@
#!/bin/bash
cat >$backup <<-EOF
# -----------------------------------
# 警告...请不要修改或删除这个文件...谢谢
# 警告...请不要修改或删除这个文件...谢谢
# 警告...请不要修改或删除这个文件...谢谢
# -----------------------------------
# ---- 再次提醒 ----
# 大胸弟...如果你看到了这个...记得不要修改或更改这个文件
# ---- 说明 ----
# 嗯……这个文件呢,是用来备份一些设置的
# 我懒...不想用 JQ 去解析 JSON....
# 那就把 V2Ray 配置文件的一些重要参数提取出来
# 然后..在修改 V2Ray 配置的时候再重写一下就 OK 啦...
# 嗯…笨笨的方法
# ---- V2Ray 传输协议 -----
v2ray_transport=$v2ray_transport
#---- V2Ray 端口 -----
v2ray_port=$v2ray_port
#---- UUID -----
v2ray_id=$v2ray_id
#---- alterId -----
alterId=$alterId
#---- V2Ray 动态端口开始 -----
v2ray_dynamicPort_start=$v2ray_dynamicPort_start
#---- V2Ray 动态端口结束 -----
v2ray_dynamicPort_end=$v2ray_dynamicPort_end
#---- 域名 -----
domain=$domain
#---- caddy -----
caddy_status=$caddy_status
#---- Shadowsocks -----
shadowsocks_status=$shadowsocks_status
#---- Shadowsocks 端口 -----
ssport=$ssport
#---- Shadowsocks 密码 -----
sspass=$sspass
#---- Shadowsocks 加密协议 -----
ssciphers=$ssciphers
#---- 屏蔽广告 -----
blocked_ad_status=$blocked_ad_status
#---- 网站伪装 -----
path_status=$ws_path_status
#---- 伪装的路径 -----
path=$ws_path
#---- 伪装的网址 -----
proxy_site=$proxy_site
EOF
. $backup

1430
v2ray.sh

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save