Merge pull request #1 from 233boy/master

update20180606
pull/197/head
windy222 7 years ago committed by GitHub
commit 69d9a81bb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      config/233blog.com.cer
  2. 27
      config/233blog.com.key
  3. 10
      config/backup.conf
  4. 13231
      config/blocked_hosts/server/h2.json
  5. 13244
      config/blocked_hosts/server/h2_ss.json
  6. 28
      config/blocked_hosts/server/http_ss.json
  7. 13215
      config/blocked_hosts/server/socks.json
  8. 13228
      config/blocked_hosts/server/socks_ss.json
  9. 7
      config/client/h2.json
  10. 104
      config/client/socks.json
  11. 8
      config/client/ws_tls.json
  12. 78
      config/server/h2.json
  13. 91
      config/server/h2_ss.json
  14. 62
      config/server/socks.json
  15. 75
      config/server/socks_ss.json
  16. 454
      install.sh
  17. 75
      tools/support_socks.sh
  18. 1318
      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,16 @@ ssciphers=chacha20-ietf
blocked_ad_status= blocked_ad_status=
#---- 网站伪装 ----- #---- 网站伪装 -----
ws_path_status= path_status=
#---- 伪装的路径 ----- #---- 伪装的路径 -----
ws_path=233blog 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

@ -27,13 +27,27 @@
"status": "200", "status": "200",
"reason": "OK", "reason": "OK",
"headers": { "headers": {
"Content-encoding": ["gzip"], "Content-encoding": [
"Content-Type": ["text/html; charset=utf-8"], "gzip"
"Cache-Control": ["no-cache"], ],
"Vary": ["Accept-Encoding"], "Content-Type": [
"X-Frame-Options": ["deny"], "text/html; charset=utf-8"
"X-XSS-Protection": ["1; mode=block"], ],
"X-content-type-options": ["nosniff"] "Cache-Control": [
"no-cache"
],
"Vary": [
"Accept-Encoding"
],
"X-Frame-Options": [
"deny"
],
"X-XSS-Protection": [
"1; mode=block"
],
"X-content-type-options": [
"nosniff"
]
} }
} }
} }

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": { "streamSettings": {
"network": "h2", "network": "h2",
"security": "tls", "security": "tls",
"tlsSettings": {
"serverName": "233blog.com",
"allowInsecure": false
},
"httpSettings": { "httpSettings": {
"host": [
"233blog.com"
],
"path": "/233blog" "path": "/233blog"
} }
}, },

@ -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"
}
]
}
}
}

@ -34,11 +34,13 @@
"network": "ws", "network": "ws",
"security": "tls", "security": "tls",
"tlsSettings": { "tlsSettings": {
"serverName": "233blog.com", "serverName": "233blog.com"
"allowInsecure": false
}, },
"wsSettings": { "wsSettings": {
"path": "/233blog" "path": "/233blog",
"headers": {
"Host": "233blog.com"
}
} }
}, },
"mux": { "mux": {

@ -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"
}
]
}
}
}

@ -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"
}
]
}
}
}

@ -62,6 +62,8 @@ transport=(
mKCP_utp_dynamicPort mKCP_utp_dynamicPort
mKCP_srtp_dynamicPort mKCP_srtp_dynamicPort
mKCP_wechat-video_dynamicPort mKCP_wechat-video_dynamicPort
HTTP/2
Socks5
) )
ciphers=( ciphers=(
@ -97,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-5]) [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"
@ -113,7 +115,8 @@ v2ray_config() {
v2ray_port_config v2ray_port_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] | 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"]"
@ -133,42 +136,17 @@ v2ray_port_config() {
;; ;;
esac esac
done done
if [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]]; then
elif [[ $v2ray_transport_opt -ge 9 ]]; then v2ray_dynamic_port_start
elif [[ $v2ray_transport_opt == 17 ]]; then
v2ray_dynamic_port_config socks_user_config
socks_pass_config
else
ws_config
fi 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 tls_config
;; ;;
esac esac
done
v2ray_dynamic_port_start
} }
v2ray_dynamic_port_start() { v2ray_dynamic_port_start() {
@ -239,7 +217,53 @@ v2ray_dynamic_port_end() {
} }
ws_config() { 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() {
echo echo
local random=$(shuf -i20001-65535 -n1) local random=$(shuf -i20001-65535 -n1)
@ -314,6 +338,18 @@ ws_config() {
done 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 " echo -e "
安装 Caddy 来实现 自动配置 TLS 安装 Caddy 来实现 自动配置 TLS
@ -356,20 +392,17 @@ ws_config() {
fi fi
done done
if [[ $caddy ]]; then
ws_path_config_ask
fi
} }
ws_path_config_ask() { path_config_ask() {
echo echo
while :; do while :; do
echo -e "是否开启 网站伪装 和 路径分流 [${magenta}Y/N$none]" echo -e "是否开启 网站伪装 和 路径分流 [${magenta}Y/N$none]"
read -p "$(echo -e "(默认: [${cyan}N$none]):")" is_ws_path read -p "$(echo -e "(默认: [${cyan}N$none]):")" is_path
[[ -z $is_ws_path ]] && is_ws_path="n" [[ -z $is_path ]] && is_path="n"
case $is_ws_path in case $is_path in
Y | y) Y | y)
ws_path_config path_config
break break
;; ;;
N | n) N | n)
@ -386,14 +419,14 @@ ws_path_config_ask() {
esac esac
done done
} }
ws_path_config() { path_config() {
echo echo
while :; do while :; do
echo -e "请输入想要 ${magenta}用来分流的路径$none , 例如 /233blog , 那么只需要输入 233blog 即可" echo -e "请输入想要 ${magenta}用来分流的路径$none , 例如 /233blog , 那么只需要输入 233blog 即可"
read -p "$(echo -e "(默认: [${cyan}233blog$none]):")" ws_path read -p "$(echo -e "(默认: [${cyan}233blog$none]):")" path
[[ -z $ws_path ]] && ws_path="233blog" [[ -z $path ]] && path="233blog"
case $ws_path in case $path in
*[/$]*) *[/$]*)
echo echo
echo -e " 由于这个脚本太辣鸡了..所以分流的路径不能包含$red / $none或$red $ $none这两个符号.... " echo -e " 由于这个脚本太辣鸡了..所以分流的路径不能包含$red / $none或$red $ $none这两个符号.... "
@ -403,7 +436,7 @@ ws_path_config() {
*) *)
echo echo
echo echo
echo -e "$yellow 分流的路径 = ${cyan}/${ws_path}$none" echo -e "$yellow 分流的路径 = ${cyan}/${path}$none"
echo "----------------------------------------------------------------" echo "----------------------------------------------------------------"
echo echo
break break
@ -511,9 +544,12 @@ shadowsocks_port_config() {
error 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]) [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
echo -e "由于你选择了 "$green"WebSocket + TLS"$none" 传输协议." echo -e "由于你选择了 "$green"WebSocket + TLS $none或$green HTTP/2"$none" 传输协议."
echo echo
echo -e "所以不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口" echo -e "所以不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
error error
@ -612,7 +648,7 @@ install_info() {
echo echo
echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport_opt - 1]}$none" 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
echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none" echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none"
echo echo
@ -626,16 +662,28 @@ install_info() {
echo echo
echo -e "$yellow 广告拦截 = $cyan$blocked_ad_info$none" echo -e "$yellow 广告拦截 = $cyan$blocked_ad_info$none"
fi fi
if [[ $ws_path ]]; then if [[ $path ]]; then
echo echo
echo -e "$yellow 路径分流 = ${cyan}/${ws_path}$none" echo -e "$yellow 路径分流 = ${cyan}/${path}$none"
fi fi
elif [[ $v2ray_transport_opt -ge 9 ]]; then elif [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]]; then
echo echo
echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none" echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none"
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"
@ -740,17 +788,19 @@ install_caddy() {
} }
caddy_config() { caddy_config() {
local email=$(shuf -i1-10000000000 -n1) local email=$(shuf -i1-10000000000 -n1)
if [[ $ws_path ]]; then case $v2ray_transport_opt in
4)
if [[ $path ]]; then
cat >/etc/caddy/Caddyfile <<-EOF cat >/etc/caddy/Caddyfile <<-EOF
$domain { $domain {
tls ${email}@gmail.com tls ${email}@gmail.com
gzip gzip
timeouts none timeouts none
proxy / $proxy_site { proxy / $proxy_site {
without /${ws_path} without /${path}
} }
proxy /${ws_path} 127.0.0.1:${v2ray_port} { proxy /${path} 127.0.0.1:${v2ray_port} {
without /${ws_path} without /${path}
websocket websocket
} }
} }
@ -766,6 +816,40 @@ $domain {
} }
EOF 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 # systemctl restart caddy
do_service restart caddy do_service restart caddy
@ -784,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
@ -874,6 +959,14 @@ install_v2ray() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/kcp_ss_dynamic.json" 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" 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"
;;
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
@ -913,6 +1006,14 @@ install_v2ray() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/kcp_ss_dynamic.json" 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" 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"
;;
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
@ -954,6 +1055,14 @@ install_v2ray() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/blocked_hosts/server/kcp_dynamic.json" 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" 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"
;;
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
@ -993,6 +1102,14 @@ install_v2ray() {
v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/kcp_dynamic.json" 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" 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"
;;
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
@ -1092,7 +1209,7 @@ config() {
sed -i "28s/6666/$ssport/; 30s/chacha20-ietf/$ssciphers/; 31s/233blog.com/$sspass/" $v2ray_server_config sed -i "28s/6666/$ssport/; 30s/chacha20-ietf/$ssciphers/; 31s/233blog.com/$sspass/" $v2ray_server_config
;; ;;
2) 2)
sed -i "50s/6666/$ssport/; 52s/chacha20-ietf/$ssciphers/; 53s/233blog.com/$sspass/" $v2ray_server_config sed -i "64s/6666/$ssport/; 66s/chacha20-ietf/$ssciphers/; 67s/233blog.com/$sspass/" $v2ray_server_config
;; ;;
3 | 4) 3 | 4)
sed -i "31s/6666/$ssport/; 33s/chacha20-ietf/$ssciphers/; 34s/233blog.com/$sspass/" $v2ray_server_config sed -i "31s/6666/$ssport/; 33s/chacha20-ietf/$ssciphers/; 34s/233blog.com/$sspass/" $v2ray_server_config
@ -1106,10 +1223,15 @@ config() {
10) 10)
sed -i "67s/6666/$ssport/; 69s/chacha20-ietf/$ssciphers/; 70s/233blog.com/$sspass/; 78s/10000-20000/$multi_port/" $v2ray_server_config 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 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
;;
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
@ -1147,7 +1269,7 @@ config() {
10) 10)
sed -i "67s/10000-20000/$multi_port/" $v2ray_server_config 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 sed -i "34s/10000-20000/$multi_port/" $v2ray_server_config
;; ;;
esac esac
@ -1181,20 +1303,35 @@ 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
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 ]]; then 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 sed -i "s/233blog.com/$domain/; 22s/2333/443/; 25s/$old_id/$uuid/" $v2ray_client_config
if [[ $ws_path ]]; then if [[ $path ]]; then
sed -i "41s/233blog/$ws_path/" $v2ray_client_config sed -i "40s/233blog/$path/" $v2ray_client_config
else else
sed -i "41s/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
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 if [[ $cmd == "apt-get" ]]; then
cat >/etc/network/if-pre-up.d/iptables <<-EOF cat >/etc/network/if-pre-up.d/iptables <<-EOF
@ -1214,11 +1351,11 @@ config() {
fi fi
[ $shadowsocks ] && open_port $ssport [ $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 "80"
open_port "443" open_port "443"
open_port $v2ray_port 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 $v2ray_port
open_port "multiport" open_port "multiport"
else else
@ -1232,20 +1369,22 @@ config() {
backup_config() { backup_config() {
sed -i "18s/=1/=$v2ray_transport_opt/; 21s/=2333/=$v2ray_port/; 24s/=$old_id/=$uuid/" $backup 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 sed -i "30s/=10000/=$v2ray_dynamic_port_start_input/; 33s/=20000/=$v2ray_dynamic_port_end_input/" $backup
fi fi
if [ $shadowsocks ]; then if [ $shadowsocks ]; then
sed -i "42s/=/=true/; 45s/=6666/=$ssport/; 48s/=233blog.com/=$sspass/; 51s/=chacha20-ietf/=$ssciphers/" $backup sed -i "42s/=/=true/; 45s/=6666/=$ssport/; 48s/=233blog.com/=$sspass/; 51s/=chacha20-ietf/=$ssciphers/" $backup
fi 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 [ $caddy ] && sed -i "39s/=/=true/" $backup
[ $is_blocked_ad ] && sed -i "54s/=/=true/" $backup [ $is_blocked_ad ] && sed -i "54s/=/=true/" $backup
if [[ $ws_path ]]; then if [[ $path ]]; then
sed -i "57s/=/=true/; 60s/=233blog/=$ws_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() {
@ -1286,53 +1425,58 @@ do_service() {
} }
show_config_info() { show_config_info() {
local header="none" local header="none"
if [[ $ws_path ]]; then if [[ $path ]]; then
local host="/$ws_path" local _path="/$path"
else else
local host="" local _path="/"
fi fi
case $v2ray_transport_opt in case $v2ray_transport_opt in
1 | 9) 1 | 9)
local net="tcp" local net="tcp"
local network="tcp" # local network="tcp"
local obfs="none" # local obfs="none"
;; ;;
2 | 10) 2 | 10)
local net="tcp" local net="tcp"
local network="tcp" # local network="tcp"
local header="http" local header="http"
local host="www.baidu.com" local host="www.baidu.com"
local obfs="http" # local obfs="http"
;; ;;
3 | 4 | 11) 3 | 4 | 11)
local net="ws" local net="ws"
local network="ws (WebSocket)" # local network="ws"
local obfs="websocket" # local obfs="websocket"
;; ;;
5 | 12) 5 | 12)
local net="kcp" local net="kcp"
local network="kcp" # local network="kcp"
;; ;;
6 | 13) 6 | 13)
local net="kcp" local net="kcp"
local network="kcp" # local network="kcp"
local header="utp" local header="utp"
;; ;;
7 | 14) 7 | 14)
local net="kcp" local net="kcp"
local network="kcp" # local network="kcp"
local header="srtp" local header="srtp"
;; ;;
8 | 15) 8 | 15)
local net="kcp" local net="kcp"
local network="kcp" # local network="kcp"
local header="wechat-video" local header="wechat-video"
;; ;;
16)
local net="h2"
# local network="h2"
;;
esac esac
if [[ $v2ray_transport_opt == "4" ]]; then if [[ $v2ray_transport_opt == "4" || $v2ray_transport_opt == 16 ]]; then
cat >/etc/v2ray/vmess_qr.json <<-EOF cat >/etc/v2ray/vmess_qr.json <<-EOF
{ {
"v": "2",
"ps": "233blog_v2ray_${domain}", "ps": "233blog_v2ray_${domain}",
"add": "${domain}", "add": "${domain}",
"port": "443", "port": "443",
@ -1340,13 +1484,15 @@ show_config_info() {
"aid": "233", "aid": "233",
"net": "${net}", "net": "${net}",
"type": "none", "type": "none",
"host": "${host}", "host": "${domain}",
"path": "$_path",
"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",
"ps": "233blog_v2ray_${ip}", "ps": "233blog_v2ray_${ip}",
"add": "${ip}", "add": "${ip}",
"port": "${v2ray_port}", "port": "${v2ray_port}",
@ -1355,20 +1501,11 @@ show_config_info() {
"net": "${net}", "net": "${net}",
"type": "${header}", "type": "${header}",
"host": "${host}", "host": "${host}",
"path": "",
"tls": "" "tls": ""
} }
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 安装完成 -------------"
@ -1382,7 +1519,7 @@ show_config_info() {
echo echo
fi fi
echo "---------- V2Ray 配置信息 -------------" echo "---------- V2Ray 配置信息 -------------"
if [[ $v2ray_transport_opt == "4" ]]; then if [[ $v2ray_transport_opt == "4" || $v2ray_transport_opt == 16 ]]; then
echo echo
echo -e "$yellow 地址 (Address) = $cyan${domain}$none" echo -e "$yellow 地址 (Address) = $cyan${domain}$none"
echo echo
@ -1392,19 +1529,30 @@ show_config_info() {
echo echo
echo -e "$yellow 额外ID (Alter Id) = ${cyan}233${none}" echo -e "$yellow 额外ID (Alter Id) = ${cyan}233${none}"
echo echo
echo -e "$yellow 传输协议 (Network) = ${cyan}${network}$none" echo -e "$yellow 传输协议 (Network) = ${cyan}${net}$none"
echo echo
echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none" echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none"
echo echo
if [[ $ws_path ]]; then echo -e "$yellow 伪装域名 (host) = ${cyan}${domain}$none"
echo -e "$yellow WebSocket 路径 (WS path) = ${cyan}/${ws_path}$none" echo
echo -e "$yellow 路径 (path) = ${cyan}${_path}$none"
echo echo
fi
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 -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 echo
else else
echo echo
echo -e "$yellow 地址 (Address) = $cyan${ip}$none" echo -e "$yellow 地址 (Address) = $cyan${ip}$none"
@ -1419,18 +1567,11 @@ 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 && $is_blocked_ad ]]; then if [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]] && [[ $is_blocked_ad ]]; then
echo " 备注: 动态端口已启用...广告拦截已开启..." echo " 备注: 动态端口已启用...广告拦截已开启..."
echo echo
elif [[ $v2ray_transport_opt -ge 9 ]]; then elif [[ $v2ray_transport_opt -ge 9 && $v2ray_transport_opt -le 15 ]]; then
echo " 备注: 动态端口已启用..." echo " 备注: 动态端口已启用..."
echo echo
elif [[ $is_blocked_ad ]]; then elif [[ $is_blocked_ad ]]; then
@ -1454,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]"
@ -1469,13 +1614,13 @@ create_qr_link_ask() {
break break
elif [[ $y_n == [Nn] ]]; then elif [[ $y_n == [Nn] ]]; then
rm -rf /etc/v2ray/vmess_qr.json rm -rf /etc/v2ray/vmess_qr.json
rm -rf /etc/v2ray/shadowray_qr.txt # rm -rf /etc/v2ray/shadowray_qr.txt
break break
else else
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]"
@ -1486,7 +1631,7 @@ create_qr_link_ask() {
break break
elif [[ $y_n == [Nn] ]]; then elif [[ $y_n == [Nn] ]]; then
rm -rf /etc/v2ray/vmess_qr.json rm -rf /etc/v2ray/vmess_qr.json
rm -rf /etc/v2ray/shadowray_qr.txt # rm -rf /etc/v2ray/shadowray_qr.txt
break break
else else
error error
@ -1500,49 +1645,23 @@ 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
echo "---------- V2Ray 二维码链接 -------------" echo "---------- V2Ray 二维码链接 -------------"
echo echo
echo -e "$yellow 适用于 V2RayNG / Kitsunebi = $cyan${link1}$none" 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
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 echo
echo echo
echo "---------- Shadowsocks 二维码链接 -------------" echo "---------- Shadowsocks 二维码链接 -------------"
@ -1571,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 / Kitsunebi = $cyan${link1}$none"
echo echo -e "$yellow 适用于 V2RayNG v0.4.1+ / Kitsunebi = $cyan${link1}$none"
if [[ $ios_qr && $link3 ]]; then
echo -e "$yellow 适用于 Pepi / ShadowRay = $cyan${link3}$none"
echo 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 echo
echo echo
echo "----------------------------------------------------------------" echo "----------------------------------------------------------------"
@ -1615,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
@ -1730,11 +1832,11 @@ uninstall() {
del_port $ssport del_port $ssport
fi fi
if [[ $v2ray_transport == "4" ]]; then if [[ $v2ray_transport == "4" || $v2ray_transport == 16 ]]; then
del_port "80" del_port "80"
del_port "443" del_port "443"
del_port $v2ray_port 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 $v2ray_port
del_port "multiport" del_port "multiport"
else else
@ -1788,11 +1890,11 @@ uninstall() {
del_port $ssport del_port $ssport
fi fi
if [[ $v2ray_transport == "4" ]]; then if [[ $v2ray_transport == "4" || $v2ray_transport == 16 ]]; then
del_port "80" del_port "80"
del_port "443" del_port "443"
del_port $v2ray_port 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 $v2ray_port
del_port "multiport" del_port "multiport"
else else

@ -0,0 +1,75 @@
#!/bin/bash
[[ $ws_path_status ]] && path_status=$ws_path_status
[[ $ws_path ]] && path=$ws_path
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=$path_status
#---- 伪装的路径 -----
path=$path
#---- 伪装的网址 -----
proxy_site=$proxy_site
#---- Socks5 用户名 -----
username=233blog
#---- Socks5 密码 -----
userpass=233blog.com
EOF
. $backup

1318
v2ray.sh

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