├── config
├── domain.txt
├── server
│ ├── include
│ │ ├── ban.json
│ │ ├── bt.json
│ │ ├── ss.json
│ │ ├── mtproto.json
│ │ └── socks.json
│ ├── ws.json
│ ├── tcp.json
│ ├── kcp.json
│ ├── quic.json
│ ├── h2.json
│ ├── dynamic
│ │ ├── tcp.json
│ │ ├── ws.json
│ │ ├── quic.json
│ │ ├── kcp.json
│ │ └── http.json
│ └── http.json
├── hosts.sh
├── 233blog.com.cer
├── backup.conf
├── 233blog.com.key
└── client
│ ├── tcp.json
│ ├── ws.json
│ ├── quic.json
│ ├── h2.json
│ ├── kcp.json
│ ├── ws_tls.json
│ └── http.json
├── .gitattributes
├── .github
└── ISSUE_TEMPLATE.md
├── src
├── ban_xx.sh
├── ban_ad.sh
├── ban_bt.sh
├── init.sh
├── custom_rules.sh
├── custom_config.sh
├── config.sh
├── ss-config.sh
├── socks-config.sh
├── mtproto-config.sh
├── ss-info.sh
├── transport.sh
├── caddy-config.sh
├── download-caddy.sh
├── bt.sh
├── download-v2ray.sh
├── v2ray-info.sh
├── uninstall.sh
├── vmess-config.sh
├── mtproto.sh
└── socks.sh
├── tools
├── quic.sh
├── reconfig.sh
├── v3.sh
└── v1xx_to_v3xx.sh
├── templates
├── rules
│ ├── ban_ip.json
│ ├── ban_client_ip.json
│ ├── ban_domain.json
│ ├── only_allow_client_ip.json
│ └── only_allow_domain.json
├── mtproto.json
├── ws.json
├── tcp.json
├── ss.json
├── socks.json
├── kcp.json
├── quic.json
├── h2.json
├── multiple.json
└── http.json
├── README.md
├── install.sh
└── LICENSE
/config/domain.txt:
--------------------------------------------------------------------------------
1 | ## 欢迎 PR 要屏蔽的域名
2 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | 提问之前,请先查阅:[V2Ray 一键安装脚本疑问集合](https://v2ray6.com/post/10/)
2 |
3 | 若需要发起提问,请删除这些内容
4 |
--------------------------------------------------------------------------------
/config/server/include/ban.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "field",
3 | "domain": [
4 | "domain:360.com"
5 | ],
6 | "outboundTag": "blocked"
7 | }
8 |
--------------------------------------------------------------------------------
/src/ban_xx.sh:
--------------------------------------------------------------------------------
1 | # ban domain
2 | ban_xx_file="/etc/v2ray/233boy/v2ray/config/server/include/ban.json"
3 | sed -i "/\/\/include_ban_xx/r $ban_xx_file" $v2ray_server_config
4 | sed -i "s#//include_ban_xx#,#" $v2ray_server_config
5 |
--------------------------------------------------------------------------------
/src/ban_ad.sh:
--------------------------------------------------------------------------------
1 | # ban ad
2 | if [[ $ban_ad ]]; then
3 | ban_ad_file="/etc/v2ray/233boy/v2ray/config/server/include/ad.json"
4 | sed -i "/\/\/include_ban_ad/r $ban_ad_file" $v2ray_server_config
5 | sed -i "s#//include_ban_ad#,#" $v2ray_server_config
6 | fi
7 |
--------------------------------------------------------------------------------
/src/ban_bt.sh:
--------------------------------------------------------------------------------
1 | # ban bt
2 | if [[ $ban_bt ]]; then
3 | ban_bt_file="/etc/v2ray/233boy/v2ray/config/server/include/bt.json"
4 | sed -i "/\/\/include_ban_bt/r $ban_bt_file" $v2ray_server_config
5 | sed -i "s#//include_ban_bt#,#" $v2ray_server_config
6 | fi
7 |
--------------------------------------------------------------------------------
/src/init.sh:
--------------------------------------------------------------------------------
1 | _rm() {
2 | rm -rf "$@"
3 | }
4 | _cp() {
5 | cp -f "$@"
6 | }
7 | _sed() {
8 | sed -i "$@"
9 | }
10 | _mkdir() {
11 | mkdir -p "$@"
12 | }
13 |
14 | _load() {
15 | local _dir="/etc/v2ray/233boy/v2ray/src/"
16 | . "${_dir}$@"
17 | }
--------------------------------------------------------------------------------
/tools/quic.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | backup="/etc/v2ray/233blog_v2ray_backup.conf"
3 | . $backup
4 | if [[ $v2ray_transport -ge 13 ]]; then
5 | tmp_transport=$(($v2ray_transport +6))
6 | sed -i "18s/=$v2ray_transport/=$tmp_transport/" $backup
7 | fi
8 | v2ray update.sh
9 |
--------------------------------------------------------------------------------
/config/server/include/bt.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "field",
3 | "protocol": [
4 | "bittorrent"
5 | ],
6 | "outboundTag": "blocked"
7 | }
8 |
--------------------------------------------------------------------------------
/src/custom_rules.sh:
--------------------------------------------------------------------------------
1 | # custom rules
2 | if [[ -f /etc/v2ray/custom/rules.json ]]; then
3 | custom_rules_file="/etc/v2ray/custom/rules.json"
4 | sed -i "/\/\/include_rules/r $custom_rules_file" $v2ray_server_config
5 | sed -i "s#//include_rules#,#" $v2ray_server_config
6 | fi
7 |
--------------------------------------------------------------------------------
/templates/rules/ban_ip.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "field",
3 | "ip": [
4 | "127.0.0.0/8",
5 | "1.1.1.1",
6 | "1.1.1.2"
7 | ],
8 | "outboundTag": "blocked" // don't change this tag
9 | }
10 | // https://v2ray.com/chapter_02/03_routing.html
--------------------------------------------------------------------------------
/src/custom_config.sh:
--------------------------------------------------------------------------------
1 | # custom config
2 | if [[ -f /etc/v2ray/custom/config.json ]]; then
3 | custom_config_file="/etc/v2ray/custom/config.json"
4 | sed -i "/\/\/include_config/r $custom_config_file" $v2ray_server_config
5 | sed -i "s#//include_config#,#" $v2ray_server_config
6 | fi
7 |
--------------------------------------------------------------------------------
/templates/rules/ban_client_ip.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "field",
3 | "source": [
4 | "127.0.0.0/8",
5 | "1.1.1.1",
6 | "1.1.1.2"
7 | ],
8 | "outboundTag": "blocked" // don't change this tag
9 | }
10 | // https://v2ray.com/chapter_02/03_routing.html
--------------------------------------------------------------------------------
/templates/rules/ban_domain.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "field",
3 | "domain": [
4 | "domain:baidu.com",
5 | "2345.com",
6 | "360.com"
7 | ],
8 | "outboundTag": "blocked" // don't change this tag
9 | }
10 | // https://v2ray.com/chapter_02/03_routing.html
--------------------------------------------------------------------------------
/config/hosts.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # 生成要屏蔽的域名... MVPS HOSTS....
4 | curl "http://winhelp2002.mvps.org/hosts.txt" -o hosts.txt
5 | sed -i '/^#/d; /localhost/d; /^$/d; s/0.0.0.0 //g; s/ //' hosts.txt
6 | sed -i 's/#\(.*\)//g' hosts.txt
7 | sed -i '/^\s*$/d' hosts.txt
8 | sed -i 's/^/"/; s/\s*$/",/' hosts.txt
9 | sed -i '$s/,//' hosts.txt
--------------------------------------------------------------------------------
/config/server/include/ss.json:
--------------------------------------------------------------------------------
1 | {
2 | "protocol": "shadowsocks",
3 | "port": 6666,
4 | "settings": {
5 | "method": "chacha20-ietf",
6 | "password": "233blog.com",
7 | "network": "tcp,udp",
8 | "level": 1,
9 | "ota": false
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/config/server/include/mtproto.json:
--------------------------------------------------------------------------------
1 | {
2 | "protocol": "mtproto",
3 | "port": 6666,
4 | "tag": "tg-in",
5 | "settings": {
6 | "users": [
7 | {
8 | "secret": "bb8a7fbd7190e345024845f07373ec48"
9 | }
10 | ]
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/templates/mtproto.json:
--------------------------------------------------------------------------------
1 | {
2 | "protocol": "mtproto",
3 | "port": 6666, //port
4 | "tag": "tg-in",
5 | "settings": {
6 | "users": [
7 | {
8 | "secret": "bb8a7fbd7190e345024845f07373ec48" // secret
9 | }
10 | ]
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/config.sh:
--------------------------------------------------------------------------------
1 |
2 | # vmess
3 | _load vmess-config.sh
4 |
5 | # ban domain
6 | _load ban_xx.sh
7 |
8 | # ban bt
9 | _load ban_bt.sh
10 |
11 | # ban ad
12 | _load ban_ad.sh
13 |
14 | # custom rules
15 | _load custom_rules.sh
16 |
17 | # ss
18 | _load ss-config.sh
19 |
20 | # socks
21 | _load socks-config.sh
22 |
23 | # mtproto
24 | _load mtproto-config.sh
25 |
26 | # custom config
27 | _load custom_config.sh
28 |
--------------------------------------------------------------------------------
/templates/rules/only_allow_client_ip.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "field",
3 | "ip": [
4 | "1.1.1.1",
5 | "1.1.1.2",
6 | "3.3.3.3"
7 | ],
8 | "outboundTag": "direct" // don't change this tag
9 | }, // ignore this error
10 | {
11 | "type": "field",
12 | "network": "tcp,udp",
13 | "outboundTag": "blocked" // don't change this tag
14 | }
15 | // https://v2ray.com/chapter_02/03_routing.html
--------------------------------------------------------------------------------
/templates/ws.json:
--------------------------------------------------------------------------------
1 | {
2 | "port": 2333, // v2ray port
3 | "protocol": "vmess",
4 | "settings": {
5 | "clients": [
6 | {
7 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79", // uuid
8 | "level": 1,
9 | "alterId": 233 // alterid
10 | }
11 | ]
12 | },
13 | "streamSettings": {
14 | "network": "ws"
15 | },
16 | "sniffing": {
17 | "enabled": true,
18 | "destOverride": [
19 | "http",
20 | "tls"
21 | ]
22 | }
23 | }
--------------------------------------------------------------------------------
/templates/tcp.json:
--------------------------------------------------------------------------------
1 | {
2 | "port": 2333, // v2ray port
3 | "protocol": "vmess",
4 | "settings": {
5 | "clients": [
6 | {
7 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79", // uuid
8 | "level": 1,
9 | "alterId": 233 // alterid
10 | }
11 | ]
12 | },
13 | "streamSettings": {
14 | "network": "tcp"
15 | },
16 | "sniffing": {
17 | "enabled": true,
18 | "destOverride": [
19 | "http",
20 | "tls"
21 | ]
22 | }
23 | }
--------------------------------------------------------------------------------
/templates/rules/only_allow_domain.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "field",
3 | "domain": [
4 | "domain:google.com",
5 | "domain:github.com",
6 | "youtube.com"
7 | ],
8 | "outboundTag": "direct" // don't change this tag
9 | }, // ignore this error
10 | {
11 | "type": "field",
12 | "network": "tcp,udp",
13 | "outboundTag": "blocked" // don't change this tag
14 | }
15 | // https://v2ray.com/chapter_02/03_routing.html
--------------------------------------------------------------------------------
/src/ss-config.sh:
--------------------------------------------------------------------------------
1 | # shadowsocks config
2 | if [[ $shadowsocks ]]; then
3 | ss_file="/etc/v2ray/233boy/v2ray/config/server/include/ss.json"
4 | ss_file_tmp="/tmp/ss.json.tmp"
5 | cp -f $ss_file $ss_file_tmp
6 | sed -i "s/6666/$ssport/; s/chacha20-ietf/$ssciphers/; s/233blog.com/$sspass/" $ss_file_tmp
7 | sed -i "/\/\/include_ss/r $ss_file_tmp" $v2ray_server_config
8 | sed -i "s#//include_ss#,#" $v2ray_server_config
9 | rm -rf $ss_file_tmp
10 | fi
11 |
--------------------------------------------------------------------------------
/src/socks-config.sh:
--------------------------------------------------------------------------------
1 | # Socks config
2 | if [[ $socks ]]; then
3 | socks_file="/etc/v2ray/233boy/v2ray/config/server/include/socks.json"
4 | socks_file_tmp="/tmp/socks.json.tmp"
5 | cp -f $socks_file $socks_file_tmp
6 | sed -i "s/6666/$socks_port/; s/v2ray66.com/$socks_username/; s/233blog.com/$socks_userpass/" $socks_file_tmp
7 | sed -i "/\/\/include_socks/r $socks_file_tmp" $v2ray_server_config
8 | sed -i "s#//include_socks#,#" $v2ray_server_config
9 | rm -rf $socks_file_tmp
10 | fi
11 |
--------------------------------------------------------------------------------
/templates/ss.json:
--------------------------------------------------------------------------------
1 | {
2 | "protocol": "shadowsocks",
3 | "port": 6666, // port
4 | "settings": {
5 | "method": "chacha20-ietf", // options > [aes-256-cfb, aes-128-cfb, chacha20, chacha20-ietf, aes-256-gcm, aes-128-gcm, chacha20-ietf-poly1305]
6 | "password": "233blog.com", // password
7 | "network": "tcp,udp",
8 | "level": 1,
9 | "ota": false
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/mtproto-config.sh:
--------------------------------------------------------------------------------
1 | # shadowsocks config
2 | if [[ $mtproto ]]; then
3 | mtproto_file="/etc/v2ray/233boy/v2ray/config/server/include/mtproto.json"
4 | mtproto_file_tmp="/tmp/ss.json.tmp"
5 | cp -f $mtproto_file $mtproto_file_tmp
6 | sed -i "s/6666/$mtproto_port/; s/bb8a7fbd7190e345024845f07373ec48/$mtproto_secret/" $mtproto_file_tmp
7 | sed -i "/\/\/include_mtproto/r $mtproto_file_tmp" $v2ray_server_config
8 | sed -i "s#//include_mtproto#,#" $v2ray_server_config
9 | rm -rf $mtproto_file_tmp
10 | fi
11 |
--------------------------------------------------------------------------------
/config/server/include/socks.json:
--------------------------------------------------------------------------------
1 | {
2 | "protocol": "socks",
3 | "port": 6666,
4 | "settings": {
5 | "auth": "password",
6 | "accounts": [
7 | {
8 | "user": "v2ray66.com",
9 | "pass": "233blog.com"
10 | }
11 | ],
12 | "udp": true,
13 | "timeout": 0,
14 | "userLevel": 1
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/templates/socks.json:
--------------------------------------------------------------------------------
1 | {
2 | "protocol": "socks",
3 | "port": 6666, // port
4 | "settings": {
5 | "auth": "password",
6 | "accounts": [
7 | {
8 | "user": "v2ray66.com", // username
9 | "pass": "233blog.com" // passowrd
10 | }
11 | ],
12 | "udp": true,
13 | "timeout": 0,
14 | "userLevel": 1
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/templates/kcp.json:
--------------------------------------------------------------------------------
1 | {
2 | "port": 2333, // v2ray port
3 | "protocol": "vmess",
4 | "settings": {
5 | "clients": [
6 | {
7 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79", // uuid
8 | "level": 1,
9 | "alterId": 233 // alaterid
10 | }
11 | ]
12 | },
13 | "streamSettings": {
14 | "network": "kcp",
15 | "kcpSettings": {
16 | "header": {
17 | "type": "none" // options > [none, srtp, utp, wechat-video, dtls, wireguard]
18 | }
19 | }
20 | },
21 | "sniffing": {
22 | "enabled": true,
23 | "destOverride": [
24 | "http",
25 | "tls"
26 | ]
27 | }
28 | }
--------------------------------------------------------------------------------
/templates/quic.json:
--------------------------------------------------------------------------------
1 | {
2 | "port": 2333, // v2ray port
3 | "protocol": "vmess",
4 | "settings": {
5 | "clients": [
6 | {
7 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79", // uuid
8 | "level": 1,
9 | "alterId": 233 // alaterid
10 | }
11 | ]
12 | },
13 | "streamSettings": {
14 | "network": "quic",
15 | "security": "aes-128-gcm",
16 | "key": "",
17 | "quicSettings": {
18 | "header": {
19 | "type": "none" // options > [none, srtp, utp, wechat-video, dtls, wireguard]
20 | }
21 | }
22 | },
23 | "sniffing": {
24 | "enabled": true,
25 | "destOverride": [
26 | "http",
27 | "tls"
28 | ]
29 | }
30 | }
--------------------------------------------------------------------------------
/src/ss-info.sh:
--------------------------------------------------------------------------------
1 | [[ -z $ip ]] && get_ip
2 | if [[ $shadowsocks ]]; then
3 | local ss="ss://$(echo -n "${ssciphers}:${sspass}@${ip}:${ssport}" | base64 -w 0)#v2ray6.com_ss_${ip}"
4 | echo
5 | echo "---------- Shadowsocks 配置信息 -------------"
6 | echo
7 | echo -e "$yellow 服务器地址 = $cyan${ip}$none"
8 | echo
9 | echo -e "$yellow 服务器端口 = $cyan$ssport$none"
10 | echo
11 | echo -e "$yellow 密码 = $cyan$sspass$none"
12 | echo
13 | echo -e "$yellow 加密协议 = $cyan${ssciphers}$none"
14 | echo
15 | echo -e "$yellow SS 链接 = ${cyan}$ss$none"
16 | echo
17 | echo -e " 备注:$red Shadowsocks Win 4.0.6 $none客户端可能无法识别该 SS 链接"
18 | echo
19 | echo -e "提示: 输入$cyan v2ray ssqr $none可生成 Shadowsocks 二维码链接"
20 | echo
21 | fi
22 |
--------------------------------------------------------------------------------
/src/transport.sh:
--------------------------------------------------------------------------------
1 | transport=(
2 | TCP
3 | TCP_HTTP
4 | WebSocket
5 | "WebSocket + TLS"
6 | HTTP/2
7 | mKCP
8 | mKCP_utp
9 | mKCP_srtp
10 | mKCP_wechat-video
11 | mKCP_dtls
12 | mKCP_wireguard
13 | QUIC
14 | QUIC_utp
15 | QUIC_srtp
16 | QUIC_wechat-video
17 | QUIC_dtls
18 | QUIC_wireguard
19 | TCP_dynamicPort
20 | TCP_HTTP_dynamicPort
21 | WebSocket_dynamicPort
22 | mKCP_dynamicPort
23 | mKCP_utp_dynamicPort
24 | mKCP_srtp_dynamicPort
25 | mKCP_wechat-video_dynamicPort
26 | mKCP_dtls_dynamicPort
27 | mKCP_wireguard_dynamicPort
28 | QUIC_dynamicPort
29 | QUIC_utp_dynamicPort
30 | QUIC_srtp_dynamicPort
31 | QUIC_wechat-video_dynamicPort
32 | QUIC_dtls_dynamicPort
33 | QUIC_wireguard_dynamicPort
34 | )
35 |
--------------------------------------------------------------------------------
/templates/h2.json:
--------------------------------------------------------------------------------
1 | {
2 | "port": 2333, // v2ray port
3 | "protocol": "vmess",
4 | "settings": {
5 | "clients": [
6 | {
7 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79", // uuid
8 | "level": 1,
9 | "alterId": 233 // alterid
10 | }
11 | ]
12 | },
13 | "streamSettings": {
14 | "network": "h2",
15 | "httpSettings": {
16 | "host": [
17 | "233blog.com" // domain
18 | ],
19 | "path": "/233blog" // path
20 | },
21 | "security": "tls",
22 | "tlsSettings": {
23 | "certificates": [
24 | {
25 | "certificateFile": "/etc/v2ray/233boy/v2ray/config/233blog.com.cer",
26 | "keyFile": "/etc/v2ray/233boy/v2ray/config/233blog.com.key"
27 | }
28 | ]
29 | }
30 | },
31 | "sniffing": {
32 | "enabled": true,
33 | "destOverride": [
34 | "http",
35 | "tls"
36 | ]
37 | }
38 | }
--------------------------------------------------------------------------------
/templates/multiple.json:
--------------------------------------------------------------------------------
1 | {
2 | "port": 2333, // v2ray port
3 | "protocol": "vmess",
4 | "settings": {
5 | "clients": [
6 | {
7 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79", // uuid
8 | "level": 1,
9 | "alterId": 233 // alterid
10 | }
11 | ]
12 | },
13 | "streamSettings": {
14 | "network": "tcp"
15 | },
16 | "sniffing": {
17 | "enabled": true,
18 | "destOverride": [
19 | "http",
20 | "tls"
21 | ]
22 | }
23 | }, // ignore this error
24 | {
25 | "protocol": "shadowsocks",
26 | "port": 6666, // port
27 | "settings": {
28 | "method": "chacha20-ietf", // options > [aes-256-cfb, aes-128-cfb, chacha20, chacha20-ietf, aes-256-gcm, aes-128-gcm, chacha20-ietf-poly1305]
29 | "password": "233blog.com", // password
30 | "network": "tcp,udp",
31 | "level": 1,
32 | "ota": false
33 | }
34 | }
--------------------------------------------------------------------------------
/templates/http.json:
--------------------------------------------------------------------------------
1 | {
2 | "port": 2333, // v2ray port
3 | "protocol": "vmess",
4 | "settings": {
5 | "clients": [
6 | {
7 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79", // uuid
8 | "level": 1,
9 | "alterId": 233 // alterid
10 | }
11 | ]
12 | },
13 | "streamSettings": {
14 | "network": "tcp",
15 | "tcpSettings": {
16 | "header": {
17 | "type": "http",
18 | "response": {
19 | "version": "1.1",
20 | "status": "200",
21 | "reason": "OK",
22 | "headers": {
23 | "Content-encoding": [
24 | "gzip"
25 | ],
26 | "Content-Type": [
27 | "text/html; charset=utf-8"
28 | ],
29 | "Cache-Control": [
30 | "no-cache"
31 | ],
32 | "Vary": [
33 | "Accept-Encoding"
34 | ],
35 | "X-Frame-Options": [
36 | "deny"
37 | ],
38 | "X-XSS-Protection": [
39 | "1; mode=block"
40 | ],
41 | "X-content-type-options": [
42 | "nosniff"
43 | ]
44 | }
45 | }
46 | }
47 | }
48 | },
49 | "sniffing": {
50 | "enabled": true,
51 | "destOverride": [
52 | "http",
53 | "tls"
54 | ]
55 | }
56 | }
--------------------------------------------------------------------------------
/config/233blog.com.cer:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDFzCCAf+gAwIBAgIQVeM+8iZUKrI+M9rkL41DjjANBgkqhkiG9w0BAQsFADAf
3 | MQswCQYDVQQKEwJBSTEQMA4GA1UEAxMHMjMzQmxvZzAgFw0xODA1MDExMDIwMjFa
4 | GA8yMjg0MDcwNzE2MjAyMVowHzELMAkGA1UEChMCQUkxEDAOBgNVBAMTBzIzM0Js
5 | b2cwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDn4tPOuedCbB6kerwg
6 | 5PSU9tdmGvQc2jVh9xXDfBjSknKkjZoylJ1+IFLRhxl3RtYBgN1xFLhVVOnqpprA
7 | KqTbDomsk59+iktmNzZW2b5HuIi3onZ9jxtcwos+rvILrJPgcjX/4qCki/4QWekR
8 | aY6LOSuRGqEbIq9Yqqd4/PzLWh1q2pgv2qwwKZlkQTnTj8xs1rlEE7wd/2ibmaHR
9 | FgcvRw04TEFUbRRevC7gcyesB8dpfZX1c2OUKtUHp0z0CHF2Tby5g52FAti4YJag
10 | HSQmOssCz8JLOhZ9fVp2cuwrDZc2sOn/Jl22ZJHHwNU142HkcuBTye/aAnl0SM3f
11 | /vGTAgMBAAGjTTBLMA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcD
12 | ATAMBgNVHRMBAf8EAjAAMBYGA1UdEQQPMA2CCzIzM2Jsb2cuY29tMA0GCSqGSIb3
13 | DQEBCwUAA4IBAQCmyLW3R2Je30zEbMObtjF2oNNj7ELH+bLgRXUIlCzjMcYB9m7d
14 | K+2ntfK5iA6tNV2Q4timcSxls15wxPd59oI76ShXA/jSV08fRaq7drDQsOy/jGyn
15 | pU1PiQKEDj7dJOLgPWlNZM3cAkretn+owWtY2JIjrVrU8OA9anGes3nT2egrXmHR
16 | B+6YPvl+WtPkFIpf+dBJxtIvvJEg0of6HDQvsQfXDIgCQzUHcRt0jtRejK1WzSLf
17 | CVjs6H4GFRCr74dC3ovGyQqOznOK0m3QRYUNonQG9s1EAMJ2XBflq5/tqbx9Ef/o
18 | CwOT+fjKVhMnbvMN4yCkJeJyDIPdWvHOdawk
19 | -----END CERTIFICATE-----
20 |
--------------------------------------------------------------------------------
/src/caddy-config.sh:
--------------------------------------------------------------------------------
1 | local email=$(((RANDOM << 22)))
2 | case $v2ray_transport in
3 | 4)
4 | if [[ $is_path ]]; then
5 | cat >/etc/caddy/Caddyfile <<-EOF
6 | $domain {
7 | tls ${email}@gmail.com
8 | gzip
9 | timeouts none
10 | proxy / $proxy_site {
11 | except /${path}
12 | }
13 | proxy /${path} 127.0.0.1:${v2ray_port} {
14 | without /${path}
15 | websocket
16 | }
17 | }
18 | import sites/*
19 | EOF
20 | else
21 | cat >/etc/caddy/Caddyfile <<-EOF
22 | $domain {
23 | tls ${email}@gmail.com
24 | timeouts none
25 | proxy / 127.0.0.1:${v2ray_port} {
26 | websocket
27 | }
28 | }
29 | import sites/*
30 | EOF
31 | fi
32 | ;;
33 | 5)
34 | if [[ $is_path ]]; then
35 | cat >/etc/caddy/Caddyfile <<-EOF
36 | $domain {
37 | tls ${email}@gmail.com
38 | gzip
39 | timeouts none
40 | proxy / $proxy_site {
41 | except /${path}
42 | }
43 | proxy /${path} https://127.0.0.1:${v2ray_port} {
44 | header_upstream Host {host}
45 | header_upstream X-Forwarded-Proto {scheme}
46 | insecure_skip_verify
47 | }
48 | }
49 | import sites/*
50 | EOF
51 | else
52 | cat >/etc/caddy/Caddyfile <<-EOF
53 | $domain {
54 | tls ${email}@gmail.com
55 | timeouts none
56 | proxy / https://127.0.0.1:${v2ray_port} {
57 | header_upstream Host {host}
58 | header_upstream X-Forwarded-Proto {scheme}
59 | insecure_skip_verify
60 | }
61 | }
62 | import sites/*
63 | EOF
64 | fi
65 | ;;
66 |
67 | esac
68 |
--------------------------------------------------------------------------------
/config/backup.conf:
--------------------------------------------------------------------------------
1 | # -----------------------------------
2 | # 警告...请不要修改或删除这个文件...谢谢
3 | # 警告...请不要修改或删除这个文件...谢谢
4 | # 警告...请不要修改或删除这个文件...谢谢
5 | # -----------------------------------
6 |
7 | # ---- 再次提醒 ----
8 | # 大胸弟...如果你看到了这个...记得不要修改或更改这个文件
9 |
10 | # ---- 说明 ----
11 | # 嗯……这个文件呢,是用来备份一些设置的
12 | #
13 | mark=v3
14 | #
15 | #
16 |
17 | # ---- V2Ray 传输协议 -----
18 | v2ray_transport=1
19 |
20 | #---- V2Ray 端口 -----
21 | v2ray_port=2333
22 |
23 | #---- UUID -----
24 | v2ray_id=e55c8d17-2cf3-b21a-bcf1-eeacb011ed79
25 |
26 | #---- alterId -----
27 | alterId=233
28 |
29 | #---- V2Ray 动态端口开始 -----
30 | v2ray_dynamicPort_start=10000
31 |
32 | #---- V2Ray 动态端口结束 -----
33 | v2ray_dynamicPort_end=20000
34 |
35 | #---- 域名 -----
36 | domain=233blog.com
37 |
38 | #---- caddy -----
39 | caddy=
40 |
41 | #---- Shadowsocks -----
42 | shadowsocks=
43 |
44 | #---- Shadowsocks 端口 -----
45 | ssport=6666
46 |
47 | #---- Shadowsocks 密码 -----
48 | sspass=233blog.com
49 |
50 | #---- Shadowsocks 加密协议 -----
51 | ssciphers=chacha20-ietf
52 |
53 | #---- 屏蔽广告 -----
54 | ban_ad=
55 |
56 | #---- 网站伪装 -----
57 | path_status=
58 |
59 | #---- 伪装的路径 -----
60 | path=233blog
61 |
62 | #---- 伪装的网址 -----
63 | proxy_site=https://liyafly.com
64 |
65 | #---- Socks -----
66 | socks=
67 |
68 | #---- Socks 端口-----
69 | socks_port=233
70 |
71 | #---- Socks 用户名 -----
72 | socks_username=233blog
73 |
74 | #---- Socks 密码 -----
75 | socks_userpass=233blog.com
76 |
77 | #---- MTProto -----
78 | mtproto=
79 |
80 | #---- MTProto 端口-----
81 | mtproto_port=233
82 |
83 | #---- MTProto 用户密钥 -----
84 | mtproto_secret=lalala
85 |
86 | #---- 屏蔽 BT -----
87 | ban_bt=true
--------------------------------------------------------------------------------
/src/download-caddy.sh:
--------------------------------------------------------------------------------
1 | _download_caddy_file() {
2 | caddy_tmp="/tmp/install_caddy/"
3 | caddy_tmp_file="/tmp/install_caddy/caddy.tar.gz"
4 | [[ -d $caddy_tmp ]] && rm -rf $caddy_tmp
5 | if [[ $sys_bit == "i386" || $sys_bit == "i686" ]]; then
6 | local caddy_download_link="https://caddyserver.com/download/linux/386?license=personal"
7 | else
8 | local caddy_download_link="https://caddyserver.com/download/linux/amd64?license=personal"
9 | fi
10 |
11 | mkdir -p $caddy_tmp
12 |
13 | if ! wget --no-check-certificate -O "$caddy_tmp_file" $caddy_download_link; then
14 | echo -e "$red 下载 Caddy 失败!$none" && exit 1
15 | fi
16 |
17 | tar zxf $caddy_tmp_file -C $caddy_tmp
18 | cp -f ${caddy_tmp}caddy /usr/local/bin/
19 |
20 | if [[ ! -f /usr/local/bin/caddy ]]; then
21 | echo -e "$red 安装 Caddy 出错!" && exit 1
22 | fi
23 | }
24 | _install_caddy_service() {
25 | setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/caddy
26 |
27 | if [[ $systemd ]]; then
28 | cp -f ${caddy_tmp}init/linux-systemd/caddy.service /lib/systemd/system/
29 | # sed -i "s/www-data/root/g" /lib/systemd/system/caddy.service
30 | sed -i "s/on-abnormal/always/" /lib/systemd/system/caddy.service
31 | systemctl enable caddy
32 | else
33 | cp -f ${caddy_tmp}init/linux-sysvinit/caddy /etc/init.d/caddy
34 | # sed -i "s/www-data/root/g" /etc/init.d/caddy
35 | chmod +x /etc/init.d/caddy
36 | update-rc.d -f caddy defaults
37 | fi
38 |
39 | mkdir -p /etc/ssl/caddy
40 |
41 | if [ -z "$(grep www-data /etc/passwd)" ]; then
42 | useradd -M -s /usr/sbin/nologin www-data
43 | fi
44 | chown -R www-data.www-data /etc/ssl/caddy
45 |
46 | mkdir -p /etc/caddy/
47 | }
48 |
--------------------------------------------------------------------------------
/src/bt.sh:
--------------------------------------------------------------------------------
1 | _ban_bt_main() {
2 | if [[ $ban_bt ]]; then
3 | local _info="$green已开启$none"
4 | else
5 | local _info="$red已关闭$none"
6 | fi
7 | _opt=''
8 | while :; do
9 | echo
10 | echo -e "$yellow 1. $none开启 BT 屏蔽"
11 | echo
12 | echo -e "$yellow 2. $none关闭 BT 屏蔽"
13 | echo
14 | echo -e "当前 BT 屏蔽状态: $_info"
15 | echo
16 | read -p "$(echo -e "请选择 [${magenta}1-2$none]:")" _opt
17 | if [[ -z $_opt ]]; then
18 | error
19 | else
20 | case $_opt in
21 | 1)
22 | if [[ $ban_bt ]]; then
23 | echo
24 | echo -e " 大胸弟...难不成你没有看到 (当前 BT 屏蔽状态: $_info) 这个帅帅的提示么.....还开启个鸡鸡哦"
25 | echo
26 | else
27 | echo
28 | echo
29 | echo -e "$yellow BT 屏蔽 = $cyan开启$none"
30 | echo "----------------------------------------------------------------"
31 | echo
32 | pause
33 | backup_config +bt
34 | ban_bt=true
35 | config
36 | echo
37 | echo
38 | echo -e "$green BT 屏蔽已开启...如果出现异常..那就关闭它咯$none"
39 | echo
40 | fi
41 | break
42 | ;;
43 | 2)
44 | if [[ $ban_bt ]]; then
45 | echo
46 | echo
47 | echo -e "$yellow BT 屏蔽 = $cyan关闭$none"
48 | echo "----------------------------------------------------------------"
49 | echo
50 | pause
51 | backup_config -bt
52 | ban_bt=''
53 | config
54 | echo
55 | echo
56 | echo -e "$red BT 屏蔽已关闭...不过你也可以随时重新开启 ...只要你喜欢$none"
57 | echo
58 | else
59 | echo
60 | echo -e " 大胸弟...难不成你没有看到 (当前 BT 屏蔽状态: $_info) 这个帅帅的提示么.....还关闭个鸡鸡哦"
61 | echo
62 | fi
63 | break
64 | ;;
65 | *)
66 | error
67 | ;;
68 | esac
69 | fi
70 | done
71 | }
72 |
--------------------------------------------------------------------------------
/tools/reconfig.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | uuid=$(cat /proc/sys/kernel/random/uuid)
3 | cat >/etc/v2ray/233blog_v2ray_backup.conf.tmp <<-EOF
4 | # -----------------------------------
5 | # 警告...请不要修改或删除这个文件...谢谢
6 | # 警告...请不要修改或删除这个文件...谢谢
7 | # 警告...请不要修改或删除这个文件...谢谢
8 | # -----------------------------------
9 |
10 | # ---- 再次提醒 ----
11 | # 大胸弟...如果你看到了这个...记得不要修改或更改这个文件
12 |
13 | # ---- 说明 ----
14 | # 嗯……这个文件呢,是用来备份一些设置的
15 | # 我懒...不想用 JQ 去解析 JSON....
16 | # 那就把 V2Ray 配置文件的一些重要参数提取出来
17 | # 然后..在修改 V2Ray 配置的时候再重写一下就 OK 啦...
18 | # 嗯…笨笨的方法
19 |
20 | # ---- V2Ray 传输协议 -----
21 | v2ray_transport=$v2ray_transport
22 |
23 | #---- V2Ray 端口 -----
24 | v2ray_port=$v2ray_port
25 |
26 | #---- UUID -----
27 | v2ray_id=$uuid
28 |
29 | #---- alterId -----
30 | alterId=233
31 |
32 | #---- V2Ray 动态端口开始 -----
33 | v2ray_dynamicPort_start=$v2ray_dynamicPort_start
34 |
35 | #---- V2Ray 动态端口结束 -----
36 | v2ray_dynamicPort_end=$v2ray_dynamicPort_end
37 |
38 | #---- 域名 -----
39 | domain=$domain
40 |
41 | #---- caddy -----
42 | caddy_status=$caddy_installed
43 |
44 | #---- Shadowsocks -----
45 | shadowsocks_status=$shadowsocks
46 |
47 | #---- Shadowsocks 端口 -----
48 | ssport=$ssport
49 |
50 | #---- Shadowsocks 密码 -----
51 | sspass=$sspass
52 |
53 | #---- Shadowsocks 加密协议 -----
54 | ssciphers=$ssciphers
55 |
56 | #---- 屏蔽广告 -----
57 | blocked_ad_status=$is_blocked_ad
58 |
59 | #---- 网站伪装 -----
60 | ws_path_status=$is_ws_path
61 |
62 | #---- 伪装的路径 -----
63 | ws_path=$ws_path
64 |
65 | #---- 伪装的网址 -----
66 | proxy_site=$proxy_site
67 | EOF
68 | rm -rf $backup
69 | mv -f /etc/v2ray/233blog_v2ray_backup.conf.tmp /etc/v2ray/233blog_v2ray_backup.conf
70 | echo
71 | echo -e " .... 哇哦.. .."
72 | echo
73 | echo -e " 请使用命令$yellow v2ray reload $none重新加载配置...以避免发生莫名其妙的问题"
74 | echo
75 | exit 1
--------------------------------------------------------------------------------
/config/233blog.com.key:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIIEowIBAAKCAQEA5+LTzrnnQmwepHq8IOT0lPbXZhr0HNo1YfcVw3wY0pJypI2a
3 | MpSdfiBS0YcZd0bWAYDdcRS4VVTp6qaawCqk2w6JrJOffopLZjc2Vtm+R7iIt6J2
4 | fY8bXMKLPq7yC6yT4HI1/+KgpIv+EFnpEWmOizkrkRqhGyKvWKqnePz8y1odatqY
5 | L9qsMCmZZEE504/MbNa5RBO8Hf9om5mh0RYHL0cNOExBVG0UXrwu4HMnrAfHaX2V
6 | 9XNjlCrVB6dM9Ahxdk28uYOdhQLYuGCWoB0kJjrLAs/CSzoWfX1adnLsKw2XNrDp
7 | /yZdtmSRx8DVNeNh5HLgU8nv2gJ5dEjN3/7xkwIDAQABAoIBAEqvb/DBR47JLAVl
8 | 0nn1xCDGcBHe1IkGbvMilcvkiEoqCOqfAO8RlrgsyP/bN4SHOB471xa4ybYSJ1UA
9 | XA9QrNAxGn6O/WvQNwCw/7txXivTb5VVqjw+f12c+yQxTJwd9XLw1huYbo0Q2b+C
10 | deK50MNeon2VyhXnUfqI3G/Ha9RCkP1kLXUJY5cU/BCHtY/tBxcgxeAqHp39h92Z
11 | 6yqJcZ7zcu+UUrQPbn3Oo8+rohKLz1crIfe3EEH72OO9LkaAA8nXeA06bKqaoZjP
12 | o+KF6Mb7E67JBlalpadWIYUEj7lGmUU22kP57T6YNF/2E1PyPNHCyO5PoUzGgTFV
13 | G+cCCuECgYEA7RHo8cdsZZdIPYc1sBu9qfhxNezdElzT4qfjJ1sibD7rtO6ZVS/9
14 | eqRj8H0KSQzERQ9G8OuiBvcmzjo2VNiSCT/9wRIH7TrvAxcnCFdOI5k+W5XAYxoz
15 | BoxdfB3KziTLlcOSLFU8ID5BjbkwBiIbZ+RZ4MhPGOHcQokvspWiUiUCgYEA+mbz
16 | KvpF5+Uu8Mc3nEEUXa+6l3ZC85bRH0MCS0CtdFF3N3Tuteaa8IzTiumy4OAy8Y4j
17 | 57VYX0TRosZhwqaFFB4dHnpJvxK7u8eI3Xqb7VQ6c0jQDK0GhmWz0i4WCZQUeFsa
18 | 3b6goclgo5y5z31G08XKYB6o4foLK1NrnHpEu1cCgYB7h1qPKW/VG9gbn2mdQ0c3
19 | 2un6xFqJZ+9MaljVuAoex0aAt9cT6Xa2QhSFSlJisBFRPt2jSdTatkv1J6YJ3fNy
20 | eHKb+O5CcfP680R2dy+TIxW4GTbvLMarwdYwh0GW2ttuRULUcPFsh6QW2gkpGPqY
21 | zwb6NsXoXEAuN1ewQYIcNQKBgQCrtpmeqU3y/lk4SIU8I+zhajac0z6KaKwzsfIK
22 | xOmt0IfegdOI7gDmYMxYgHZoe5azy3OX2+YkPr87zqsPnr231AbH9bhIzYHr/aM/
23 | rmrrT01d7VqutqC43Vl5Ep2OJ/v5pRBBbA4fpEcfK8TIIvLFGufzDlNl0+CA743m
24 | GnqztQKBgGxqQTInnvP8AHF7eu5L7gMs3gSrZbaSB4e6Hb9qaMdru9sOiHTmtKFc
25 | P5z1pGgKWAN7VYF2ZLzJ+NYxJn63R9mkH0PuPzh8j+0Wdkpe2msVCIuZ/wm3Iv7f
26 | VkFaQ64OitX/HpifTmh+dUaOWJ7GjW1PyDWjdPxViPdB+DQcDXFV
27 | -----END RSA PRIVATE KEY-----
28 |
--------------------------------------------------------------------------------
/src/download-v2ray.sh:
--------------------------------------------------------------------------------
1 | _get_latest_version() {
2 | v2ray_latest_ver="$(curl -H 'Cache-Control: no-cache' -s https://api.github.com/repos/v2ray/v2ray-core/releases/latest | grep 'tag_name' | cut -d\" -f4)"
3 |
4 | if [[ ! $v2ray_latest_ver ]]; then
5 | echo
6 | echo -e " $red获取 V2Ray 最新版本失败!!!$none"
7 | echo
8 | echo -e " 请尝试执行如下命令: $green echo 'nameserver 8.8.8.8' >/etc/resolv.conf $none"
9 | echo
10 | echo " 然后再重新运行脚本...."
11 | echo
12 | exit 1
13 | fi
14 | }
15 |
16 | _download_v2ray_file() {
17 | _get_latest_version
18 | [[ -d /tmp/v2ray ]] && rm -rf /tmp/v2ray
19 | mkdir -p /tmp/v2ray
20 | v2ray_tmp_file="/tmp/v2ray/v2ray.zip"
21 | v2ray_download_link="https://github.com/v2ray/v2ray-core/releases/download/$v2ray_latest_ver/v2ray-linux-${v2ray_bit}.zip"
22 |
23 | if ! wget --no-check-certificate -O "$v2ray_tmp_file" $v2ray_download_link; then
24 | echo -e "
25 | $red 下载 V2Ray 失败啦..可能是你的 VPS 网络太辣鸡了...请重试...$none
26 | " && exit 1
27 | fi
28 |
29 | unzip $v2ray_tmp_file -d "/tmp/v2ray/"
30 | mkdir -p /usr/bin/v2ray
31 | cp -f "/tmp/v2ray/v2ray" "/usr/bin/v2ray/v2ray"
32 | chmod +x "/usr/bin/v2ray/v2ray"
33 | cp -f "/tmp/v2ray/v2ctl" "/usr/bin/v2ray/v2ctl"
34 | chmod +x "/usr/bin/v2ray/v2ctl"
35 | }
36 |
37 | _install_v2ray_service() {
38 | if [[ $systemd ]]; then
39 | cp -f "/tmp/v2ray/systemd/v2ray.service" "/lib/systemd/system/"
40 | sed -i "s/on-failure/always/" /lib/systemd/system/v2ray.service
41 | systemctl enable v2ray
42 | else
43 | apt-get install -y daemon
44 | cp "/tmp/v2ray/systemv/v2ray" "/etc/init.d/v2ray"
45 | chmod +x "/etc/init.d/v2ray"
46 | update-rc.d -f v2ray defaults
47 | fi
48 | }
49 |
50 | _update_v2ray_version() {
51 | _get_latest_version
52 | if [[ $v2ray_ver != $v2ray_latest_ver ]]; then
53 | echo
54 | echo -e " $green 咦...发现新版本耶....正在拼命更新.......$none"
55 | echo
56 | _download_v2ray_file
57 | do_service restart v2ray
58 | echo
59 | echo -e " $green 更新成功啦...当前 V2Ray 版本: ${cyan}$v2ray_latest_ver$none"
60 | echo
61 | echo -e " $yellow 温馨提示: 为了避免出现莫名其妙的问题...V2Ray 客户端的版本最好和服务器的版本保持一致$none"
62 | echo
63 | else
64 | echo
65 | echo -e " $green 木有发现新版本....$none"
66 | echo
67 | fi
68 | }
69 |
70 | _mkdir_dir() {
71 | mkdir -p /var/log/v2ray
72 | mkdir -p /etc/v2ray
73 | }
74 |
--------------------------------------------------------------------------------
/tools/v3.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | case $v2ray_transport in
3 | [5-8])
4 | _transport=$(($v2ray_transport + 1))
5 | ;;
6 | 9 | 1[0-5])
7 | _transport=$(($v2ray_transport + 9))
8 | ;;
9 | 16)
10 | _transport=5
11 | ;;
12 | 17)
13 | _transport=1
14 | ;;
15 | *)
16 | _transport=$v2ray_transport
17 | ;;
18 | esac
19 |
20 | if [[ $v2ray_transport == 17 ]]; then
21 | v2ray_id=$(cat /proc/sys/kernel/random/uuid)
22 | fi
23 |
24 | cat >$backup <<-EOF
25 | # -----------------------------------
26 | # 警告...请不要修改或删除这个文件...谢谢
27 | # 警告...请不要修改或删除这个文件...谢谢
28 | # 警告...请不要修改或删除这个文件...谢谢
29 | # -----------------------------------
30 |
31 | # ---- 再次提醒 ----
32 | # 大胸弟...如果你看到了这个...记得不要修改或更改这个文件
33 |
34 | # ---- 说明 ----
35 | # 嗯……这个文件呢,是用来备份一些设置的
36 | #
37 | mark=v3
38 | #
39 | #
40 |
41 | # ---- V2Ray 传输协议 -----
42 | v2ray_transport=$_transport
43 |
44 | #---- V2Ray 端口 -----
45 | v2ray_port=$v2ray_port
46 |
47 | #---- UUID -----
48 | v2ray_id=$v2ray_id
49 |
50 | #---- alterId -----
51 | alterId=$alterId
52 |
53 | #---- V2Ray 动态端口开始 -----
54 | v2ray_dynamicPort_start=$v2ray_dynamicPort_start
55 |
56 | #---- V2Ray 动态端口结束 -----
57 | v2ray_dynamicPort_end=$v2ray_dynamicPort_end
58 |
59 | #---- 域名 -----
60 | domain=$domain
61 |
62 | #---- caddy -----
63 | caddy=$caddy_status
64 |
65 | #---- Shadowsocks -----
66 | shadowsocks=$shadowsocks_status
67 |
68 | #---- Shadowsocks 端口 -----
69 | ssport=$ssport
70 |
71 | #---- Shadowsocks 密码 -----
72 | sspass=$sspass
73 |
74 | #---- Shadowsocks 加密协议 -----
75 | ssciphers=$ssciphers
76 |
77 | #---- 屏蔽广告 -----
78 | ban_ad=$blocked_ad_status
79 |
80 | #---- 网站伪装 -----
81 | path_status=$path_status
82 |
83 | #---- 伪装的路径 -----
84 | path=$path
85 |
86 | #---- 伪装的网址 -----
87 | proxy_site=$proxy_site
88 |
89 | #---- Socks -----
90 | socks=
91 |
92 | #---- Socks 端口-----
93 | socks_port=233
94 |
95 | #---- Socks 用户名 -----
96 | socks_username=233blog
97 |
98 | #---- Socks 密码 -----
99 | socks_userpass=233blog.com
100 |
101 | #---- MTProto -----
102 | mtproto=
103 |
104 | #---- MTProto 端口-----
105 | mtproto_port=233
106 |
107 | #---- MTProto 用户密钥 -----
108 | mtproto_secret=lalala
109 |
110 | #---- 屏蔽 BT -----
111 | ban_bt=true
112 | EOF
113 |
114 | . $backup
115 |
--------------------------------------------------------------------------------
/config/server/ws.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "access": "/var/log/v2ray/access.log",
4 | "error": "/var/log/v2ray/error.log",
5 | "loglevel": "warning"
6 | },
7 | "inbounds": [
8 | {
9 | "port": 2333,
10 | "protocol": "vmess",
11 | "settings": {
12 | "clients": [
13 | {
14 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
15 | "level": 1,
16 | "alterId": 233
17 | }
18 | ]
19 | },
20 | "streamSettings": {
21 | "network": "ws"
22 | },
23 | "sniffing": {
24 | "enabled": true,
25 | "destOverride": [
26 | "http",
27 | "tls"
28 | ]
29 | }
30 | }
31 | //include_ss
32 | //include_socks
33 | //include_mtproto
34 | //include_config
35 | //
36 | ],
37 | "outbounds": [
38 | {
39 | "protocol": "freedom",
40 | "settings": {}
41 | },
42 | {
43 | "protocol": "blackhole",
44 | "settings": {},
45 | "tag": "blocked"
46 | },
47 | {
48 | "protocol": "freedom",
49 | "settings": {},
50 | "tag": "direct"
51 | },
52 | {
53 | "protocol": "mtproto",
54 | "settings": {},
55 | "tag": "tg-out"
56 | }
57 | ],
58 | "dns": {
59 | "server": [
60 | "8.8.8.8",
61 | "8.8.4.4",
62 | "1.1.1.1",
63 | "1.0.0.1",
64 | "localhost"
65 | ]
66 | },
67 | "routing": {
68 | "domainStrategy": "IPOnDemand",
69 | "rules": [
70 | {
71 | "type": "field",
72 | "ip": [
73 | "0.0.0.0/8",
74 | "10.0.0.0/8",
75 | "100.64.0.0/10",
76 | "127.0.0.0/8",
77 | "169.254.0.0/16",
78 | "172.16.0.0/12",
79 | "192.0.0.0/24",
80 | "192.0.2.0/24",
81 | "192.168.0.0/16",
82 | "198.18.0.0/15",
83 | "198.51.100.0/24",
84 | "203.0.113.0/24",
85 | "::1/128",
86 | "fc00::/7",
87 | "fe80::/10"
88 | ],
89 | "outboundTag": "blocked"
90 | },
91 | {
92 | "type": "field",
93 | "inboundTag": ["tg-in"],
94 | "outboundTag": "tg-out"
95 | }
96 | //include_ban_xx
97 | //include_ban_bt
98 | //include_ban_ad
99 | //include_rules
100 | //
101 | ]
102 | },
103 | "transport": {
104 | "kcpSettings": {
105 | "uplinkCapacity": 100,
106 | "downlinkCapacity": 100,
107 | "congestion": true
108 | },
109 | "sockopt": {
110 | "tcpFastOpen": true
111 | }
112 | }
113 | }
--------------------------------------------------------------------------------
/config/server/tcp.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "access": "/var/log/v2ray/access.log",
4 | "error": "/var/log/v2ray/error.log",
5 | "loglevel": "warning"
6 | },
7 | "inbounds": [
8 | {
9 | "port": 2333,
10 | "protocol": "vmess",
11 | "settings": {
12 | "clients": [
13 | {
14 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
15 | "level": 1,
16 | "alterId": 233
17 | }
18 | ]
19 | },
20 | "streamSettings": {
21 | "network": "tcp"
22 | },
23 | "sniffing": {
24 | "enabled": true,
25 | "destOverride": [
26 | "http",
27 | "tls"
28 | ]
29 | }
30 | }
31 | //include_ss
32 | //include_socks
33 | //include_mtproto
34 | //include_config
35 | //
36 | ],
37 | "outbounds": [
38 | {
39 | "protocol": "freedom",
40 | "settings": {}
41 | },
42 | {
43 | "protocol": "blackhole",
44 | "settings": {},
45 | "tag": "blocked"
46 | },
47 | {
48 | "protocol": "freedom",
49 | "settings": {},
50 | "tag": "direct"
51 | },
52 | {
53 | "protocol": "mtproto",
54 | "settings": {},
55 | "tag": "tg-out"
56 | }
57 | ],
58 | "dns": {
59 | "server": [
60 | "8.8.8.8",
61 | "8.8.4.4",
62 | "1.1.1.1",
63 | "1.0.0.1",
64 | "localhost"
65 | ]
66 | },
67 | "routing": {
68 | "domainStrategy": "IPOnDemand",
69 | "rules": [
70 | {
71 | "type": "field",
72 | "ip": [
73 | "0.0.0.0/8",
74 | "10.0.0.0/8",
75 | "100.64.0.0/10",
76 | "127.0.0.0/8",
77 | "169.254.0.0/16",
78 | "172.16.0.0/12",
79 | "192.0.0.0/24",
80 | "192.0.2.0/24",
81 | "192.168.0.0/16",
82 | "198.18.0.0/15",
83 | "198.51.100.0/24",
84 | "203.0.113.0/24",
85 | "::1/128",
86 | "fc00::/7",
87 | "fe80::/10"
88 | ],
89 | "outboundTag": "blocked"
90 | },
91 | {
92 | "type": "field",
93 | "inboundTag": ["tg-in"],
94 | "outboundTag": "tg-out"
95 | }
96 | //include_ban_xx
97 | //include_ban_bt
98 | //include_ban_ad
99 | //include_rules
100 | //
101 | ]
102 | },
103 | "transport": {
104 | "kcpSettings": {
105 | "uplinkCapacity": 100,
106 | "downlinkCapacity": 100,
107 | "congestion": true
108 | },
109 | "sockopt": {
110 | "tcpFastOpen": true
111 | }
112 | }
113 | }
--------------------------------------------------------------------------------
/config/server/kcp.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "access": "/var/log/v2ray/access.log",
4 | "error": "/var/log/v2ray/error.log",
5 | "loglevel": "warning"
6 | },
7 | "inbounds": [
8 | {
9 | "port": 2333,
10 | "protocol": "vmess",
11 | "settings": {
12 | "clients": [
13 | {
14 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
15 | "level": 1,
16 | "alterId": 233
17 | }
18 | ]
19 | },
20 | "streamSettings": {
21 | "network": "kcp",
22 | "kcpSettings": {
23 | "header": {
24 | "type": "none"
25 | }
26 | }
27 | },
28 | "sniffing": {
29 | "enabled": true,
30 | "destOverride": [
31 | "http",
32 | "tls"
33 | ]
34 | }
35 | }
36 | //include_ss
37 | //include_socks
38 | //include_mtproto
39 | //include_config
40 | //
41 | ],
42 | "outbounds": [
43 | {
44 | "protocol": "freedom",
45 | "settings": {}
46 | },
47 | {
48 | "protocol": "blackhole",
49 | "settings": {},
50 | "tag": "blocked"
51 | },
52 | {
53 | "protocol": "freedom",
54 | "settings": {},
55 | "tag": "direct"
56 | },
57 | {
58 | "protocol": "mtproto",
59 | "settings": {},
60 | "tag": "tg-out"
61 | }
62 | ],
63 | "dns": {
64 | "server": [
65 | "8.8.8.8",
66 | "8.8.4.4",
67 | "1.1.1.1",
68 | "1.0.0.1",
69 | "localhost"
70 | ]
71 | },
72 | "routing": {
73 | "domainStrategy": "IPOnDemand",
74 | "rules": [
75 | {
76 | "type": "field",
77 | "ip": [
78 | "0.0.0.0/8",
79 | "10.0.0.0/8",
80 | "100.64.0.0/10",
81 | "127.0.0.0/8",
82 | "169.254.0.0/16",
83 | "172.16.0.0/12",
84 | "192.0.0.0/24",
85 | "192.0.2.0/24",
86 | "192.168.0.0/16",
87 | "198.18.0.0/15",
88 | "198.51.100.0/24",
89 | "203.0.113.0/24",
90 | "::1/128",
91 | "fc00::/7",
92 | "fe80::/10"
93 | ],
94 | "outboundTag": "blocked"
95 | },
96 | {
97 | "type": "field",
98 | "inboundTag": ["tg-in"],
99 | "outboundTag": "tg-out"
100 | }
101 | //include_ban_xx
102 | //include_ban_bt
103 | //include_ban_ad
104 | //include_rules
105 | //
106 | ]
107 | },
108 | "transport": {
109 | "kcpSettings": {
110 | "uplinkCapacity": 100,
111 | "downlinkCapacity": 100,
112 | "congestion": true
113 | },
114 | "sockopt": {
115 | "tcpFastOpen": true
116 | }
117 | }
118 | }
--------------------------------------------------------------------------------
/config/server/quic.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "access": "/var/log/v2ray/access.log",
4 | "error": "/var/log/v2ray/error.log",
5 | "loglevel": "warning"
6 | },
7 | "inbounds": [
8 | {
9 | "port": 2333,
10 | "protocol": "vmess",
11 | "settings": {
12 | "clients": [
13 | {
14 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
15 | "level": 1,
16 | "alterId": 233
17 | }
18 | ]
19 | },
20 | "streamSettings": {
21 | "network": "quic",
22 | "quicSettings": {
23 | "security": "aes-128-gcm",
24 | "key": "",
25 | "header": {
26 | "type": "none"
27 | }
28 | }
29 | },
30 | "sniffing": {
31 | "enabled": true,
32 | "destOverride": [
33 | "http",
34 | "tls"
35 | ]
36 | }
37 | }
38 | //include_ss
39 | //include_socks
40 | //include_mtproto
41 | //include_config
42 | //
43 | ],
44 | "outbounds": [
45 | {
46 | "protocol": "freedom",
47 | "settings": {}
48 | },
49 | {
50 | "protocol": "blackhole",
51 | "settings": {},
52 | "tag": "blocked"
53 | },
54 | {
55 | "protocol": "freedom",
56 | "settings": {},
57 | "tag": "direct"
58 | },
59 | {
60 | "protocol": "mtproto",
61 | "settings": {},
62 | "tag": "tg-out"
63 | }
64 | ],
65 | "dns": {
66 | "server": [
67 | "8.8.8.8",
68 | "8.8.4.4",
69 | "1.1.1.1",
70 | "1.0.0.1",
71 | "localhost"
72 | ]
73 | },
74 | "routing": {
75 | "domainStrategy": "IPOnDemand",
76 | "rules": [
77 | {
78 | "type": "field",
79 | "ip": [
80 | "0.0.0.0/8",
81 | "10.0.0.0/8",
82 | "100.64.0.0/10",
83 | "127.0.0.0/8",
84 | "169.254.0.0/16",
85 | "172.16.0.0/12",
86 | "192.0.0.0/24",
87 | "192.0.2.0/24",
88 | "192.168.0.0/16",
89 | "198.18.0.0/15",
90 | "198.51.100.0/24",
91 | "203.0.113.0/24",
92 | "::1/128",
93 | "fc00::/7",
94 | "fe80::/10"
95 | ],
96 | "outboundTag": "blocked"
97 | },
98 | {
99 | "type": "field",
100 | "inboundTag": ["tg-in"],
101 | "outboundTag": "tg-out"
102 | }
103 | //include_ban_xx
104 | //include_ban_bt
105 | //include_ban_ad
106 | //include_rules
107 | //
108 | ]
109 | },
110 | "transport": {
111 | "kcpSettings": {
112 | "uplinkCapacity": 100,
113 | "downlinkCapacity": 100,
114 | "congestion": true
115 | },
116 | "sockopt": {
117 | "tcpFastOpen": true
118 | }
119 | }
120 | }
--------------------------------------------------------------------------------
/config/server/h2.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "access": "/var/log/v2ray/access.log",
4 | "error": "/var/log/v2ray/error.log",
5 | "loglevel": "warning"
6 | },
7 | "inbounds": [
8 | {
9 | "port": 2333,
10 | "protocol": "vmess",
11 | "settings": {
12 | "clients": [
13 | {
14 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
15 | "level": 1,
16 | "alterId": 233
17 | }
18 | ]
19 | },
20 | "streamSettings": {
21 | "network": "h2",
22 | "httpSettings": {
23 | "host": [
24 | "233blog.com"
25 | ],
26 | "path": "/233blog"
27 | },
28 | "security": "tls",
29 | "tlsSettings": {
30 | "certificates": [
31 | {
32 | "certificateFile": "/etc/v2ray/233boy/v2ray/config/233blog.com.cer",
33 | "keyFile": "/etc/v2ray/233boy/v2ray/config/233blog.com.key"
34 | }
35 | ]
36 | }
37 | },
38 | "sniffing": {
39 | "enabled": true,
40 | "destOverride": [
41 | "http",
42 | "tls"
43 | ]
44 | }
45 | }
46 | //include_ss
47 | //include_socks
48 | //include_mtproto
49 | //include_config
50 | //
51 | ],
52 | "outbounds": [
53 | {
54 | "protocol": "freedom",
55 | "settings": {}
56 | },
57 | {
58 | "protocol": "blackhole",
59 | "settings": {},
60 | "tag": "blocked"
61 | },
62 | {
63 | "protocol": "freedom",
64 | "settings": {},
65 | "tag": "direct"
66 | },
67 | {
68 | "protocol": "mtproto",
69 | "settings": {},
70 | "tag": "tg-out"
71 | }
72 | ],
73 | "dns": {
74 | "server": [
75 | "8.8.8.8",
76 | "8.8.4.4",
77 | "1.1.1.1",
78 | "1.0.0.1",
79 | "localhost"
80 | ]
81 | },
82 | "routing": {
83 | "domainStrategy": "IPOnDemand",
84 | "rules": [
85 | {
86 | "type": "field",
87 | "ip": [
88 | "0.0.0.0/8",
89 | "10.0.0.0/8",
90 | "100.64.0.0/10",
91 | "127.0.0.0/8",
92 | "169.254.0.0/16",
93 | "172.16.0.0/12",
94 | "192.0.0.0/24",
95 | "192.0.2.0/24",
96 | "192.168.0.0/16",
97 | "198.18.0.0/15",
98 | "198.51.100.0/24",
99 | "203.0.113.0/24",
100 | "::1/128",
101 | "fc00::/7",
102 | "fe80::/10"
103 | ],
104 | "outboundTag": "blocked"
105 | },
106 | {
107 | "type": "field",
108 | "inboundTag": ["tg-in"],
109 | "outboundTag": "tg-out"
110 | }
111 | //include_ban_xx
112 | //include_ban_bt
113 | //include_ban_ad
114 | //include_rules
115 | //
116 | ]
117 | },
118 | "transport": {
119 | "kcpSettings": {
120 | "uplinkCapacity": 100,
121 | "downlinkCapacity": 100,
122 | "congestion": true
123 | },
124 | "sockopt": {
125 | "tcpFastOpen": true
126 | }
127 | }
128 | }
--------------------------------------------------------------------------------
/config/server/dynamic/tcp.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "access": "/var/log/v2ray/access.log",
4 | "error": "/var/log/v2ray/error.log",
5 | "loglevel": "warning"
6 | },
7 | "inbounds": [
8 | {
9 | "port": 2333,
10 | "protocol": "vmess",
11 | "settings": {
12 | "clients": [
13 | {
14 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
15 | "level": 1,
16 | "alterId": 233
17 | }
18 | ],
19 | "detour": {
20 | "to": "dynamic"
21 | }
22 | },
23 | "streamSettings": {
24 | "network": "tcp"
25 | },
26 | "sniffing": {
27 | "enabled": true,
28 | "destOverride": [
29 | "http",
30 | "tls"
31 | ]
32 | }
33 | },
34 | {
35 | "protocol": "vmess",
36 | "port": "10000-20000",
37 | "tag": "dynamic",
38 | "settings": {
39 | "default": {
40 | "level": 1,
41 | "alterId": 32
42 | }
43 | },
44 | "allocate": {
45 | "strategy": "random",
46 | "concurrency": 2,
47 | "refresh": 5
48 | }
49 | }
50 | //include_ss
51 | //include_socks
52 | //include_mtproto
53 | //include_config
54 | //
55 | ],
56 | "outbounds": [
57 | {
58 | "protocol": "freedom",
59 | "settings": {}
60 | },
61 | {
62 | "protocol": "blackhole",
63 | "settings": {},
64 | "tag": "blocked"
65 | },
66 | {
67 | "protocol": "freedom",
68 | "settings": {},
69 | "tag": "direct"
70 | },
71 | {
72 | "protocol": "mtproto",
73 | "settings": {},
74 | "tag": "tg-out"
75 | }
76 | ],
77 | "dns": {
78 | "server": [
79 | "8.8.8.8",
80 | "8.8.4.4",
81 | "1.1.1.1",
82 | "1.0.0.1",
83 | "localhost"
84 | ]
85 | },
86 | "routing": {
87 | "domainStrategy": "IPOnDemand",
88 | "rules": [
89 | {
90 | "type": "field",
91 | "ip": [
92 | "0.0.0.0/8",
93 | "10.0.0.0/8",
94 | "100.64.0.0/10",
95 | "127.0.0.0/8",
96 | "169.254.0.0/16",
97 | "172.16.0.0/12",
98 | "192.0.0.0/24",
99 | "192.0.2.0/24",
100 | "192.168.0.0/16",
101 | "198.18.0.0/15",
102 | "198.51.100.0/24",
103 | "203.0.113.0/24",
104 | "::1/128",
105 | "fc00::/7",
106 | "fe80::/10"
107 | ],
108 | "outboundTag": "blocked"
109 | },
110 | {
111 | "type": "field",
112 | "inboundTag": ["tg-in"],
113 | "outboundTag": "tg-out"
114 | }
115 | //include_ban_xx
116 | //include_ban_bt
117 | //include_ban_ad
118 | //include_rules
119 | //
120 | ]
121 | },
122 | "transport": {
123 | "kcpSettings": {
124 | "uplinkCapacity": 100,
125 | "downlinkCapacity": 100,
126 | "congestion": true
127 | },
128 | "sockopt": {
129 | "tcpFastOpen": true
130 | }
131 | }
132 | }
--------------------------------------------------------------------------------
/config/server/dynamic/ws.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "access": "/var/log/v2ray/access.log",
4 | "error": "/var/log/v2ray/error.log",
5 | "loglevel": "warning"
6 | },
7 | "inbounds": [
8 | {
9 | "port": 2333,
10 | "protocol": "vmess",
11 | "settings": {
12 | "clients": [
13 | {
14 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
15 | "level": 1,
16 | "alterId": 233
17 | }
18 | ],
19 | "detour": {
20 | "to": "dynamic"
21 | }
22 | },
23 | "streamSettings": {
24 | "network": "ws"
25 | },
26 | "sniffing": {
27 | "enabled": true,
28 | "destOverride": [
29 | "http",
30 | "tls"
31 | ]
32 | }
33 | },
34 | {
35 | "protocol": "vmess",
36 | "port": "10000-20000",
37 | "tag": "dynamic",
38 | "settings": {
39 | "default": {
40 | "level": 1,
41 | "alterId": 32
42 | }
43 | },
44 | "allocate": {
45 | "strategy": "random",
46 | "concurrency": 2,
47 | "refresh": 5
48 | },
49 | "streamSettings": {
50 | "network": "ws"
51 | }
52 | }
53 | //include_ss
54 | //include_socks
55 | //include_mtproto
56 | //include_config
57 | //
58 | ],
59 | "outbounds": [
60 | {
61 | "protocol": "freedom",
62 | "settings": {}
63 | },
64 | {
65 | "protocol": "blackhole",
66 | "settings": {},
67 | "tag": "blocked"
68 | },
69 | {
70 | "protocol": "freedom",
71 | "settings": {},
72 | "tag": "direct"
73 | },
74 | {
75 | "protocol": "mtproto",
76 | "settings": {},
77 | "tag": "tg-out"
78 | }
79 | ],
80 | "dns": {
81 | "server": [
82 | "8.8.8.8",
83 | "8.8.4.4",
84 | "1.1.1.1",
85 | "1.0.0.1",
86 | "localhost"
87 | ]
88 | },
89 | "routing": {
90 | "domainStrategy": "IPOnDemand",
91 | "rules": [
92 | {
93 | "type": "field",
94 | "ip": [
95 | "0.0.0.0/8",
96 | "10.0.0.0/8",
97 | "100.64.0.0/10",
98 | "127.0.0.0/8",
99 | "169.254.0.0/16",
100 | "172.16.0.0/12",
101 | "192.0.0.0/24",
102 | "192.0.2.0/24",
103 | "192.168.0.0/16",
104 | "198.18.0.0/15",
105 | "198.51.100.0/24",
106 | "203.0.113.0/24",
107 | "::1/128",
108 | "fc00::/7",
109 | "fe80::/10"
110 | ],
111 | "outboundTag": "blocked"
112 | },
113 | {
114 | "type": "field",
115 | "inboundTag": ["tg-in"],
116 | "outboundTag": "tg-out"
117 | }
118 | //include_ban_xx
119 | //include_ban_bt
120 | //include_ban_ad
121 | //include_rules
122 | //
123 | ]
124 | },
125 | "transport": {
126 | "kcpSettings": {
127 | "uplinkCapacity": 100,
128 | "downlinkCapacity": 100,
129 | "congestion": true
130 | },
131 | "sockopt": {
132 | "tcpFastOpen": true
133 | }
134 | }
135 | }
--------------------------------------------------------------------------------
/config/client/tcp.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "error": "error.log",
4 | "loglevel": "warning"
5 | },
6 | "outbounds": [
7 | {
8 | "protocol": "vmess",
9 | "settings": {
10 | "vnext": [
11 | {
12 | "address": "233blog.com",
13 | "port": 2333,
14 | "users": [
15 | {
16 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
17 | "alterId": 233,
18 | "security": "auto"
19 | }
20 | ]
21 | }
22 | ]
23 | },
24 | "mux": {
25 | "enabled": true
26 | }
27 | },
28 | {
29 | "protocol": "freedom",
30 | "settings": {},
31 | "tag": "direct"
32 | }
33 | ],
34 | "inbounds": [
35 | {
36 | "port": 2333,
37 | "listen": "127.0.0.1",
38 | "protocol": "socks",
39 | "settings": {
40 | "auth": "noauth",
41 | "udp": true,
42 | "ip": "127.0.0.1"
43 | }
44 | },
45 | {
46 | "port": 6666,
47 | "listen": "127.0.0.1",
48 | "protocol": "http",
49 | "settings": {
50 | "auth": "noauth",
51 | "udp": true,
52 | "ip": "127.0.0.1"
53 | }
54 | }
55 | ],
56 | "dns": {
57 | "servers": [
58 | "8.8.8.8",
59 | "8.8.4.4",
60 | "localhost"
61 | ]
62 | },
63 | "routing": {
64 | "domainStrategy": "IPOnDemand",
65 | "rules": [
66 | {
67 | "type": "field",
68 | "ip": [
69 | "0.0.0.0/8",
70 | "10.0.0.0/8",
71 | "100.64.0.0/10",
72 | "127.0.0.0/8",
73 | "169.254.0.0/16",
74 | "172.16.0.0/12",
75 | "192.0.0.0/24",
76 | "192.0.2.0/24",
77 | "192.168.0.0/16",
78 | "198.18.0.0/15",
79 | "198.51.100.0/24",
80 | "203.0.113.0/24",
81 | "::1/128",
82 | "fc00::/7",
83 | "fe80::/10",
84 | "geoip:cn"
85 | ],
86 | "domain": [
87 | "geosite:cn"
88 | ],
89 | "outboundTag": "direct"
90 | },
91 | {
92 | "type": "chinasites",
93 | "outboundTag": "direct"
94 | },
95 | {
96 | "type": "chinaip",
97 | "outboundTag": "direct"
98 | }
99 | ]
100 | }
101 | }
--------------------------------------------------------------------------------
/config/server/http.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "access": "/var/log/v2ray/access.log",
4 | "error": "/var/log/v2ray/error.log",
5 | "loglevel": "warning"
6 | },
7 | "inbounds": [
8 | {
9 | "port": 2333,
10 | "protocol": "vmess",
11 | "settings": {
12 | "clients": [
13 | {
14 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
15 | "level": 1,
16 | "alterId": 233
17 | }
18 | ]
19 | },
20 | "streamSettings": {
21 | "network": "tcp",
22 | "tcpSettings": {
23 | "header": {
24 | "type": "http",
25 | "response": {
26 | "version": "1.1",
27 | "status": "200",
28 | "reason": "OK",
29 | "headers": {
30 | "Content-encoding": [
31 | "gzip"
32 | ],
33 | "Content-Type": [
34 | "text/html; charset=utf-8"
35 | ],
36 | "Cache-Control": [
37 | "no-cache"
38 | ],
39 | "Vary": [
40 | "Accept-Encoding"
41 | ],
42 | "X-Frame-Options": [
43 | "deny"
44 | ],
45 | "X-XSS-Protection": [
46 | "1; mode=block"
47 | ],
48 | "X-content-type-options": [
49 | "nosniff"
50 | ]
51 | }
52 | }
53 | }
54 | }
55 | },
56 | "sniffing": {
57 | "enabled": true,
58 | "destOverride": [
59 | "http",
60 | "tls"
61 | ]
62 | }
63 | }
64 | //include_ss
65 | //include_socks
66 | //include_mtproto
67 | //include_config
68 | //
69 | ],
70 | "outbounds": [
71 | {
72 | "protocol": "freedom",
73 | "settings": {}
74 | },
75 | {
76 | "protocol": "blackhole",
77 | "settings": {},
78 | "tag": "blocked"
79 | },
80 | {
81 | "protocol": "freedom",
82 | "settings": {},
83 | "tag": "direct"
84 | },
85 | {
86 | "protocol": "mtproto",
87 | "settings": {},
88 | "tag": "tg-out"
89 | }
90 | ],
91 | "dns": {
92 | "server": [
93 | "8.8.8.8",
94 | "8.8.4.4",
95 | "1.1.1.1",
96 | "1.0.0.1",
97 | "localhost"
98 | ]
99 | },
100 | "routing": {
101 | "domainStrategy": "IPOnDemand",
102 | "rules": [
103 | {
104 | "type": "field",
105 | "ip": [
106 | "0.0.0.0/8",
107 | "10.0.0.0/8",
108 | "100.64.0.0/10",
109 | "127.0.0.0/8",
110 | "169.254.0.0/16",
111 | "172.16.0.0/12",
112 | "192.0.0.0/24",
113 | "192.0.2.0/24",
114 | "192.168.0.0/16",
115 | "198.18.0.0/15",
116 | "198.51.100.0/24",
117 | "203.0.113.0/24",
118 | "::1/128",
119 | "fc00::/7",
120 | "fe80::/10"
121 | ],
122 | "outboundTag": "blocked"
123 | },
124 | {
125 | "type": "field",
126 | "inboundTag": ["tg-in"],
127 | "outboundTag": "tg-out"
128 | }
129 | //include_ban_xx
130 | //include_ban_bt
131 | //include_ban_ad
132 | //include_rules
133 | //
134 | ]
135 | },
136 | "transport": {
137 | "kcpSettings": {
138 | "uplinkCapacity": 100,
139 | "downlinkCapacity": 100,
140 | "congestion": true
141 | },
142 | "sockopt": {
143 | "tcpFastOpen": true
144 | }
145 | }
146 | }
--------------------------------------------------------------------------------
/config/client/ws.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "error": "error.log",
4 | "loglevel": "warning"
5 | },
6 | "outbounds": [
7 | {
8 | "protocol": "vmess",
9 | "settings": {
10 | "vnext": [
11 | {
12 | "address": "233blog.com",
13 | "port": 2333,
14 | "users": [
15 | {
16 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
17 | "alterId": 233,
18 | "security": "auto"
19 | }
20 | ]
21 | }
22 | ]
23 | },
24 | "streamSettings": {
25 | "network": "ws"
26 | },
27 | "mux": {
28 | "enabled": true
29 | }
30 | },
31 | {
32 | "protocol": "freedom",
33 | "settings": {},
34 | "tag": "direct"
35 | }
36 | ],
37 | "inbounds": [
38 | {
39 | "port": 2333,
40 | "listen": "127.0.0.1",
41 | "protocol": "socks",
42 | "settings": {
43 | "auth": "noauth",
44 | "udp": true,
45 | "ip": "127.0.0.1"
46 | }
47 | },
48 | {
49 | "port": 6666,
50 | "listen": "127.0.0.1",
51 | "protocol": "http",
52 | "settings": {
53 | "auth": "noauth",
54 | "udp": true,
55 | "ip": "127.0.0.1"
56 | }
57 | }
58 | ],
59 | "dns": {
60 | "servers": [
61 | "8.8.8.8",
62 | "8.8.4.4",
63 | "localhost"
64 | ]
65 | },
66 | "routing": {
67 | "domainStrategy": "IPOnDemand",
68 | "rules": [
69 | {
70 | "type": "field",
71 | "ip": [
72 | "0.0.0.0/8",
73 | "10.0.0.0/8",
74 | "100.64.0.0/10",
75 | "127.0.0.0/8",
76 | "169.254.0.0/16",
77 | "172.16.0.0/12",
78 | "192.0.0.0/24",
79 | "192.0.2.0/24",
80 | "192.168.0.0/16",
81 | "198.18.0.0/15",
82 | "198.51.100.0/24",
83 | "203.0.113.0/24",
84 | "::1/128",
85 | "fc00::/7",
86 | "fe80::/10",
87 | "geoip:cn"
88 | ],
89 | "domain": [
90 | "geosite:cn"
91 | ],
92 | "outboundTag": "direct"
93 | },
94 | {
95 | "type": "chinasites",
96 | "outboundTag": "direct"
97 | },
98 | {
99 | "type": "chinaip",
100 | "outboundTag": "direct"
101 | }
102 | ]
103 | }
104 | }
--------------------------------------------------------------------------------
/src/v2ray-info.sh:
--------------------------------------------------------------------------------
1 | [[ -z $ip ]] && get_ip
2 | _v2_args() {
3 | header="none"
4 | if [[ $is_path ]]; then
5 | _path="/$path"
6 | else
7 | _path="/"
8 | fi
9 | case $v2ray_transport in
10 | 1 | 18)
11 | net="tcp"
12 | ;;
13 | 2 | 19)
14 | net="tcp"
15 | header="http"
16 | host="www.baidu.com"
17 | ;;
18 | 3 | 4 | 20)
19 | net="ws"
20 | ;;
21 | 5)
22 | net="h2"
23 | ;;
24 | 6 | 21)
25 | net="kcp"
26 | ;;
27 | 7 | 22)
28 | net="kcp"
29 | header="utp"
30 | ;;
31 | 8 | 23)
32 | net="kcp"
33 | header="srtp"
34 | ;;
35 | 9 | 24)
36 | net="kcp"
37 | header="wechat-video"
38 | ;;
39 | 10 | 25)
40 | net="kcp"
41 | header="dtls"
42 | ;;
43 | 11 | 26)
44 | net="kcp"
45 | header="wireguard"
46 | ;;
47 | 12 | 27)
48 | net="quic"
49 | ;;
50 | 13 | 28)
51 | net="quic"
52 | header="utp"
53 | ;;
54 | 14 | 29)
55 | net="quic"
56 | header="srtp"
57 | ;;
58 | 15 | 30)
59 | net="quic"
60 | header="wechat-video"
61 | ;;
62 | 16 | 31)
63 | net="quic"
64 | header="dtls"
65 | ;;
66 | 17 | 32)
67 | net="quic"
68 | header="wireguard"
69 | ;;
70 | esac
71 | }
72 |
73 | _v2_info() {
74 | echo
75 | echo
76 | echo "---------- V2Ray 配置信息 -------------"
77 | if [[ $v2ray_transport == [45] ]]; then
78 | if [[ ! $caddy ]]; then
79 | echo
80 | echo -e " $red警告!$none$yellow请自行配置 TLS...教程: https://v2ray6.com/post/3/$none"
81 | fi
82 | echo
83 | echo -e "$yellow 地址 (Address) = $cyan${domain}$none"
84 | echo
85 | echo -e "$yellow 端口 (Port) = ${cyan}443${none}"
86 | echo
87 | echo -e "$yellow 用户ID (User ID / UUID) = $cyan${v2ray_id}$none"
88 | echo
89 | echo -e "$yellow 额外ID (Alter Id) = ${cyan}${alterId}${none}"
90 | echo
91 | echo -e "$yellow 传输协议 (Network) = ${cyan}${net}$none"
92 | echo
93 | echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none"
94 | echo
95 | echo -e "$yellow 伪装域名 (host) = ${cyan}${domain}$none"
96 | echo
97 | echo -e "$yellow 路径 (path) = ${cyan}${_path}$none"
98 | echo
99 | echo -e "$yellow TLS (Enable TLS) = ${cyan}打开$none"
100 | echo
101 | if [[ $ban_ad ]]; then
102 | echo " 备注: 广告拦截已开启.."
103 | echo
104 | fi
105 | else
106 | echo
107 | echo -e "$yellow 地址 (Address) = $cyan${ip}$none"
108 | echo
109 | echo -e "$yellow 端口 (Port) = $cyan$v2ray_port$none"
110 | echo
111 | echo -e "$yellow 用户ID (User ID / UUID) = $cyan${v2ray_id}$none"
112 | echo
113 | echo -e "$yellow 额外ID (Alter Id) = ${cyan}${alterId}${none}"
114 | echo
115 | echo -e "$yellow 传输协议 (Network) = ${cyan}${net}$none"
116 | echo
117 | echo -e "$yellow 伪装类型 (header type) = ${cyan}${header}$none"
118 | echo
119 | fi
120 | if [[ $v2ray_transport -ge 18 ]] && [[ $ban_ad ]]; then
121 | echo " 备注: 动态端口已启用...广告拦截已开启..."
122 | echo
123 | elif [[ $v2ray_transport -ge 18 ]]; then
124 | echo " 备注: 动态端口已启用..."
125 | echo
126 | elif [[ $ban_ad ]]; then
127 | echo " 备注: 广告拦截已开启.."
128 | echo
129 | fi
130 | echo "---------- END -------------"
131 | echo
132 | echo "V2Ray 客户端使用教程: https://v2ray6.com/post/4/"
133 | echo
134 | echo -e "提示: 输入$cyan v2ray url $none可生成 vmess URL 链接 / 输入$cyan v2ray qr $none可生成二维码链接"
135 | echo
136 | }
137 |
--------------------------------------------------------------------------------
/tools/v1xx_to_v3xx.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | backup="/etc/v2ray/233blog_v2ray_backup.txt"
3 | v2ray_transport=$(sed -n '17p' $backup)
4 | v2ray_port=$(sed -n '19p' $backup)
5 | v2ray_id=$(sed -n '21p' $backup)
6 | v2ray_dynamicPort_start=$(sed -n '23p' $backup)
7 | v2ray_dynamicPort_end=$(sed -n '25p' $backup)
8 | domain=$(sed -n '27p' $backup)
9 | caddy_status=$(sed -n '29p' $backup)
10 | shadowsocks_status=$(sed -n '31p' $backup)
11 | ssport=$(sed -n '33p' $backup)
12 | sspass=$(sed -n '35p' $backup)
13 | ssciphers=$(sed -n '37p' $backup)
14 | blocked_ad_status=$(sed -n '39p' $backup)
15 | ws_path_status=$(sed -n '41p' $backup)
16 | ws_path=$(sed -n '43p' $backup)
17 | proxy_site=$(sed '$!d' $backup)
18 | if [[ $caddy_status == "true" ]]; then
19 | caddy_installed=true
20 | fi
21 | if [[ $shadowsocks_status == "true" ]]; then
22 | shadowsocks=true
23 | fi
24 | if [[ $blocked_ad_status == "true" ]]; then
25 | is_blocked_ad=true
26 | fi
27 | if [[ $ws_path_status == "true" ]]; then
28 | is_ws_path=true
29 | fi
30 |
31 | cat >/etc/v2ray/233blog_v2ray_backup.conf <<-EOF
32 | # -----------------------------------
33 | # 警告...请不要修改或删除这个文件...谢谢
34 | # 警告...请不要修改或删除这个文件...谢谢
35 | # 警告...请不要修改或删除这个文件...谢谢
36 | # -----------------------------------
37 |
38 | # ---- 再次提醒 ----
39 | # 大胸弟...如果你看到了这个...记得不要修改或更改这个文件
40 |
41 | # ---- 说明 ----
42 | # 嗯……这个文件呢,是用来备份一些设置的
43 | #
44 | #mark=v3
45 | #
46 | #
47 |
48 | # ---- V2Ray 传输协议 -----
49 | v2ray_transport=$v2ray_transport
50 |
51 | #---- V2Ray 端口 -----
52 | v2ray_port=$v2ray_port
53 |
54 | #---- UUID -----
55 | v2ray_id=$v2ray_id
56 |
57 | #---- alterId -----
58 | alterId=233
59 |
60 | #---- V2Ray 动态端口开始 -----
61 | v2ray_dynamicPort_start=$v2ray_dynamicPort_start
62 |
63 | #---- V2Ray 动态端口结束 -----
64 | v2ray_dynamicPort_end=$v2ray_dynamicPort_end
65 |
66 | #---- 域名 -----
67 | domain=$domain
68 |
69 | #---- caddy -----
70 | caddy_status=$caddy_installed
71 |
72 | #---- Shadowsocks -----
73 | shadowsocks_status=$shadowsocks
74 |
75 | #---- Shadowsocks 端口 -----
76 | ssport=$ssport
77 |
78 | #---- Shadowsocks 密码 -----
79 | sspass=$sspass
80 |
81 | #---- Shadowsocks 加密协议 -----
82 | ssciphers=$ssciphers
83 |
84 | #---- 屏蔽广告 -----
85 | blocked_ad_status=$is_blocked_ad
86 |
87 | #---- 网站伪装 -----
88 | path_status=$is_ws_path
89 |
90 | #---- 伪装的路径 -----
91 | path=$ws_path
92 |
93 | #---- 伪装的网址 -----
94 | proxy_site=$proxy_site
95 |
96 | #---- Socks -----
97 | socks=
98 |
99 | #---- Socks 端口-----
100 | socks_port=233
101 |
102 | #---- Socks 用户名 -----
103 | socks_username=233blog
104 |
105 | #---- Socks 密码 -----
106 | socks_userpass=233blog.com
107 |
108 | #---- MTProto -----
109 | mtproto=
110 |
111 | #---- MTProto 端口-----
112 | mtproto_port=233
113 |
114 | #---- MTProto 用户密钥 -----
115 | mtproto_secret=lalala
116 |
117 | #---- 屏蔽 BT -----
118 | ban_bt=true
119 | EOF
120 | if [[ -f /usr/local/bin/v2ray ]]; then
121 | cp -f /etc/v2ray/233boy/v2ray/v2ray.sh /usr/local/sbin/v2ray
122 | chmod +x /usr/local/sbin/v2ray
123 | rm -rf $backup
124 | rm -rf /usr/local/bin/v2ray
125 | fi
126 |
127 | echo
128 | echo -e " 哇哦...脚本差点就跪了..."
129 | echo
130 | echo -e "\n $yellow 警告: 请重新登录 SSH 以避免出现 v2ray 命令未找到的情况。$none \n" && exit 1
131 | echo
132 | exit 1
133 |
--------------------------------------------------------------------------------
/config/client/quic.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "error": "error.log",
4 | "loglevel": "warning"
5 | },
6 | "outbounds": [
7 | {
8 | "protocol": "vmess",
9 | "settings": {
10 | "vnext": [
11 | {
12 | "address": "233blog.com",
13 | "port": 2333,
14 | "users": [
15 | {
16 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
17 | "alterId": 233,
18 | "security": "auto"
19 | }
20 | ]
21 | }
22 | ]
23 | },
24 | "streamSettings": {
25 | "network": "quic",
26 | "quicSettings": {
27 | "security": "aes-128-gcm",
28 | "key": "",
29 | "header": {
30 | "type": "none"
31 | }
32 | }
33 | },
34 | "mux": {
35 | "enabled": true
36 | }
37 | },
38 | {
39 | "protocol": "freedom",
40 | "settings": {},
41 | "tag": "direct"
42 | }
43 | ],
44 | "inbounds": [
45 | {
46 | "port": 2333,
47 | "listen": "127.0.0.1",
48 | "protocol": "socks",
49 | "settings": {
50 | "auth": "noauth",
51 | "udp": true,
52 | "ip": "127.0.0.1"
53 | }
54 | },
55 | {
56 | "port": 6666,
57 | "listen": "127.0.0.1",
58 | "protocol": "http",
59 | "settings": {
60 | "auth": "noauth",
61 | "udp": true,
62 | "ip": "127.0.0.1"
63 | }
64 | }
65 | ],
66 | "dns": {
67 | "servers": [
68 | "8.8.8.8",
69 | "8.8.4.4",
70 | "localhost"
71 | ]
72 | },
73 | "routing": {
74 | "domainStrategy": "IPOnDemand",
75 | "rules": [
76 | {
77 | "type": "field",
78 | "ip": [
79 | "0.0.0.0/8",
80 | "10.0.0.0/8",
81 | "100.64.0.0/10",
82 | "127.0.0.0/8",
83 | "169.254.0.0/16",
84 | "172.16.0.0/12",
85 | "192.0.0.0/24",
86 | "192.0.2.0/24",
87 | "192.168.0.0/16",
88 | "198.18.0.0/15",
89 | "198.51.100.0/24",
90 | "203.0.113.0/24",
91 | "::1/128",
92 | "fc00::/7",
93 | "fe80::/10",
94 | "geoip:cn"
95 | ],
96 | "domain": [
97 | "geosite:cn"
98 | ],
99 | "outboundTag": "direct"
100 | },
101 | {
102 | "type": "chinasites",
103 | "outboundTag": "direct"
104 | },
105 | {
106 | "type": "chinaip",
107 | "outboundTag": "direct"
108 | }
109 | ]
110 | }
111 | }
--------------------------------------------------------------------------------
/config/server/dynamic/quic.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "access": "/var/log/v2ray/access.log",
4 | "error": "/var/log/v2ray/error.log",
5 | "loglevel": "warning"
6 | },
7 | "inbounds": [
8 | {
9 | "port": 2333,
10 | "protocol": "vmess",
11 | "settings": {
12 | "clients": [
13 | {
14 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
15 | "level": 1,
16 | "alterId": 233
17 | }
18 | ],
19 | "detour": {
20 | "to": "dynamic"
21 | }
22 | },
23 | "streamSettings": {
24 | "network": "quic",
25 | "quicSettings": {
26 | "security": "aes-128-gcm",
27 | "key": "",
28 | "header": {
29 | "type": "none"
30 | }
31 | }
32 | },
33 | "sniffing": {
34 | "enabled": true,
35 | "destOverride": [
36 | "http",
37 | "tls"
38 | ]
39 | }
40 | },
41 | {
42 | "protocol": "vmess",
43 | "port": "10000-20000",
44 | "tag": "dynamic",
45 | "settings": {
46 | "default": {
47 | "level": 1,
48 | "alterId": 32
49 | }
50 | },
51 | "allocate": {
52 | "strategy": "random",
53 | "concurrency": 2,
54 | "refresh": 5
55 | },
56 | "streamSettings": {
57 | "network": "quic",
58 | "quicSettings": {
59 | "security": "aes-128-gcm",
60 | "key": "",
61 | "header": {
62 | "type": "none"
63 | }
64 | }
65 | }
66 | }
67 | //include_ss
68 | //include_socks
69 | //include_mtproto
70 | //include_config
71 | //
72 | ],
73 | "outbounds": [
74 | {
75 | "protocol": "freedom",
76 | "settings": {}
77 | },
78 | {
79 | "protocol": "blackhole",
80 | "settings": {},
81 | "tag": "blocked"
82 | },
83 | {
84 | "protocol": "freedom",
85 | "settings": {},
86 | "tag": "direct"
87 | },
88 | {
89 | "protocol": "mtproto",
90 | "settings": {},
91 | "tag": "tg-out"
92 | }
93 | ],
94 | "dns": {
95 | "server": [
96 | "8.8.8.8",
97 | "8.8.4.4",
98 | "1.1.1.1",
99 | "1.0.0.1",
100 | "localhost"
101 | ]
102 | },
103 | "routing": {
104 | "domainStrategy": "IPOnDemand",
105 | "rules": [
106 | {
107 | "type": "field",
108 | "ip": [
109 | "0.0.0.0/8",
110 | "10.0.0.0/8",
111 | "100.64.0.0/10",
112 | "127.0.0.0/8",
113 | "169.254.0.0/16",
114 | "172.16.0.0/12",
115 | "192.0.0.0/24",
116 | "192.0.2.0/24",
117 | "192.168.0.0/16",
118 | "198.18.0.0/15",
119 | "198.51.100.0/24",
120 | "203.0.113.0/24",
121 | "::1/128",
122 | "fc00::/7",
123 | "fe80::/10"
124 | ],
125 | "outboundTag": "blocked"
126 | },
127 | {
128 | "type": "field",
129 | "inboundTag": ["tg-in"],
130 | "outboundTag": "tg-out"
131 | }
132 | //include_ban_xx
133 | //include_ban_bt
134 | //include_ban_ad
135 | //include_rules
136 | //
137 | ]
138 | },
139 | "transport": {
140 | "kcpSettings": {
141 | "uplinkCapacity": 100,
142 | "downlinkCapacity": 100,
143 | "congestion": true
144 | },
145 | "sockopt": {
146 | "tcpFastOpen": true
147 | }
148 | }
149 | }
--------------------------------------------------------------------------------
/config/server/dynamic/kcp.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "access": "/var/log/v2ray/access.log",
4 | "error": "/var/log/v2ray/error.log",
5 | "loglevel": "warning"
6 | },
7 | "inbounds": [
8 | {
9 | "port": 2333,
10 | "protocol": "vmess",
11 | "settings": {
12 | "clients": [
13 | {
14 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
15 | "level": 1,
16 | "alterId": 233
17 | }
18 | ],
19 | "detour": {
20 | "to": "dynamic"
21 | }
22 | },
23 | "streamSettings": {
24 | "network": "kcp",
25 | "kcpSettings": {
26 | "header": {
27 | "type": "none"
28 | }
29 | }
30 | },
31 | "sniffing": {
32 | "enabled": true,
33 | "destOverride": [
34 | "http",
35 | "tls"
36 | ]
37 | }
38 | },
39 | {
40 | "protocol": "vmess",
41 | "port": "10000-20000",
42 | "tag": "dynamic",
43 | "settings": {
44 | "default": {
45 | "level": 1,
46 | "alterId": 32
47 | }
48 | },
49 | "allocate": {
50 | "strategy": "random",
51 | "concurrency": 2,
52 | "refresh": 5
53 | },
54 | "streamSettings": {
55 | "network": "kcp",
56 | "kcpSettings": {
57 | "header": {
58 | "type": "none"
59 | }
60 | }
61 | }
62 | }
63 | //include_ss
64 | //include_socks
65 | //include_mtproto
66 | //include_config
67 | //
68 | ],
69 | "outbounds": [
70 | {
71 | "protocol": "freedom",
72 | "settings": {}
73 | },
74 | {
75 | "protocol": "blackhole",
76 | "settings": {},
77 | "tag": "blocked"
78 | },
79 | {
80 | "protocol": "freedom",
81 | "settings": {},
82 | "tag": "direct"
83 | },
84 | {
85 | "protocol": "mtproto",
86 | "settings": {},
87 | "tag": "tg-out"
88 | }
89 | ],
90 | "dns": {
91 | "server": [
92 | "8.8.8.8",
93 | "8.8.4.4",
94 | "1.1.1.1",
95 | "1.0.0.1",
96 | "localhost"
97 | ]
98 | },
99 | "routing": {
100 | "domainStrategy": "IPOnDemand",
101 | "rules": [
102 | {
103 | "type": "field",
104 | "ip": [
105 | "0.0.0.0/8",
106 | "10.0.0.0/8",
107 | "100.64.0.0/10",
108 | "127.0.0.0/8",
109 | "169.254.0.0/16",
110 | "172.16.0.0/12",
111 | "192.0.0.0/24",
112 | "192.0.2.0/24",
113 | "192.168.0.0/16",
114 | "198.18.0.0/15",
115 | "198.51.100.0/24",
116 | "203.0.113.0/24",
117 | "::1/128",
118 | "fc00::/7",
119 | "fe80::/10"
120 | ],
121 | "outboundTag": "blocked"
122 | },
123 | {
124 | "type": "field",
125 | "inboundTag": ["tg-in"],
126 | "outboundTag": "tg-out"
127 | }
128 | //include_ban_xx
129 | //include_ban_bt
130 | //include_ban_ad
131 | //include_rules
132 | //
133 | ]
134 | },
135 | "transport": {
136 | "kcpSettings": {
137 | "uplinkCapacity": 100,
138 | "downlinkCapacity": 100,
139 | "congestion": true
140 | },
141 | "sockopt": {
142 | "tcpFastOpen": true
143 | }
144 | }
145 | }
--------------------------------------------------------------------------------
/config/client/h2.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "error": "error.log",
4 | "loglevel": "warning"
5 | },
6 | "outbounds": [
7 | {
8 | "protocol": "vmess",
9 | "settings": {
10 | "vnext": [
11 | {
12 | "address": "233blog.com",
13 | "port": 2333,
14 | "users": [
15 | {
16 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
17 | "alterId": 233,
18 | "security": "auto"
19 | }
20 | ]
21 | }
22 | ]
23 | },
24 | "streamSettings": {
25 | "network": "h2",
26 | "security": "tls",
27 | "httpSettings": {
28 | "host": [
29 | "233blog.com"
30 | ],
31 | "path": "/233blog"
32 | }
33 | },
34 | "mux": {
35 | "enabled": true
36 | }
37 | },
38 | {
39 | "protocol": "freedom",
40 | "settings": {},
41 | "tag": "direct"
42 | }
43 | ],
44 | "inbounds": [
45 | {
46 | "port": 2333,
47 | "listen": "127.0.0.1",
48 | "protocol": "socks",
49 | "settings": {
50 | "auth": "noauth",
51 | "udp": true,
52 | "ip": "127.0.0.1"
53 | }
54 | },
55 | {
56 | "port": 6666,
57 | "listen": "127.0.0.1",
58 | "protocol": "http",
59 | "settings": {
60 | "auth": "noauth",
61 | "udp": true,
62 | "ip": "127.0.0.1"
63 | }
64 | }
65 | ],
66 | "dns": {
67 | "servers": [
68 | "8.8.8.8",
69 | "8.8.4.4",
70 | "localhost"
71 | ]
72 | },
73 | "routing": {
74 | "domainStrategy": "IPOnDemand",
75 | "rules": [
76 | {
77 | "type": "field",
78 | "ip": [
79 | "0.0.0.0/8",
80 | "10.0.0.0/8",
81 | "100.64.0.0/10",
82 | "127.0.0.0/8",
83 | "169.254.0.0/16",
84 | "172.16.0.0/12",
85 | "192.0.0.0/24",
86 | "192.0.2.0/24",
87 | "192.168.0.0/16",
88 | "198.18.0.0/15",
89 | "198.51.100.0/24",
90 | "203.0.113.0/24",
91 | "::1/128",
92 | "fc00::/7",
93 | "fe80::/10",
94 | "geoip:cn"
95 | ],
96 | "domain": [
97 | "geosite:cn"
98 | ],
99 | "outboundTag": "direct"
100 | },
101 | {
102 | "type": "chinasites",
103 | "outboundTag": "direct"
104 | },
105 | {
106 | "type": "chinaip",
107 | "outboundTag": "direct"
108 | }
109 | ]
110 | }
111 | }
--------------------------------------------------------------------------------
/config/client/kcp.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "error": "error.log",
4 | "loglevel": "warning"
5 | },
6 | "outbounds": [
7 | {
8 | "protocol": "vmess",
9 | "settings": {
10 | "vnext": [
11 | {
12 | "address": "233blog.com",
13 | "port": 2333,
14 | "users": [
15 | {
16 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
17 | "alterId": 233,
18 | "security": "auto"
19 | }
20 | ]
21 | }
22 | ]
23 | },
24 | "streamSettings": {
25 | "network": "kcp",
26 | "kcpSettings": {
27 | "uplinkCapacity": 100,
28 | "downlinkCapacity": 100,
29 | "congestion": true,
30 | "header": {
31 | "type": "none"
32 | }
33 | }
34 | },
35 | "mux": {
36 | "enabled": true
37 | }
38 | },
39 | {
40 | "protocol": "freedom",
41 | "settings": {},
42 | "tag": "direct"
43 | }
44 | ],
45 | "inbounds": [
46 | {
47 | "port": 2333,
48 | "listen": "127.0.0.1",
49 | "protocol": "socks",
50 | "settings": {
51 | "auth": "noauth",
52 | "udp": true,
53 | "ip": "127.0.0.1"
54 | }
55 | },
56 | {
57 | "port": 6666,
58 | "listen": "127.0.0.1",
59 | "protocol": "http",
60 | "settings": {
61 | "auth": "noauth",
62 | "udp": true,
63 | "ip": "127.0.0.1"
64 | }
65 | }
66 | ],
67 | "dns": {
68 | "servers": [
69 | "8.8.8.8",
70 | "8.8.4.4",
71 | "localhost"
72 | ]
73 | },
74 | "routing": {
75 | "domainStrategy": "IPOnDemand",
76 | "rules": [
77 | {
78 | "type": "field",
79 | "ip": [
80 | "0.0.0.0/8",
81 | "10.0.0.0/8",
82 | "100.64.0.0/10",
83 | "127.0.0.0/8",
84 | "169.254.0.0/16",
85 | "172.16.0.0/12",
86 | "192.0.0.0/24",
87 | "192.0.2.0/24",
88 | "192.168.0.0/16",
89 | "198.18.0.0/15",
90 | "198.51.100.0/24",
91 | "203.0.113.0/24",
92 | "::1/128",
93 | "fc00::/7",
94 | "fe80::/10",
95 | "geoip:cn"
96 | ],
97 | "domain": [
98 | "geosite:cn"
99 | ],
100 | "outboundTag": "direct"
101 | },
102 | {
103 | "type": "chinasites",
104 | "outboundTag": "direct"
105 | },
106 | {
107 | "type": "chinaip",
108 | "outboundTag": "direct"
109 | }
110 | ]
111 | }
112 | }
--------------------------------------------------------------------------------
/config/client/ws_tls.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "error": "error.log",
4 | "loglevel": "warning"
5 | },
6 | "outbounds": [
7 | {
8 | "protocol": "vmess",
9 | "settings": {
10 | "vnext": [
11 | {
12 | "address": "233blog.com",
13 | "port": 2333,
14 | "users": [
15 | {
16 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
17 | "alterId": 233,
18 | "security": "auto"
19 | }
20 | ]
21 | }
22 | ]
23 | },
24 | "streamSettings": {
25 | "network": "ws",
26 | "security": "tls",
27 | "tlsSettings": {
28 | "serverName": "233blog.com"
29 | },
30 | "wsSettings": {
31 | "path": "/233blog",
32 | "headers": {
33 | "Host": "233blog.com"
34 | }
35 | }
36 | },
37 | "mux": {
38 | "enabled": true
39 | }
40 | },
41 | {
42 | "protocol": "freedom",
43 | "settings": {},
44 | "tag": "direct"
45 | }
46 | ],
47 | "inbounds": [
48 | {
49 | "port": 2333,
50 | "listen": "127.0.0.1",
51 | "protocol": "socks",
52 | "settings": {
53 | "auth": "noauth",
54 | "udp": true,
55 | "ip": "127.0.0.1"
56 | }
57 | },
58 | {
59 | "port": 6666,
60 | "listen": "127.0.0.1",
61 | "protocol": "http",
62 | "settings": {
63 | "auth": "noauth",
64 | "udp": true,
65 | "ip": "127.0.0.1"
66 | }
67 | }
68 | ],
69 | "dns": {
70 | "servers": [
71 | "8.8.8.8",
72 | "8.8.4.4",
73 | "localhost"
74 | ]
75 | },
76 | "routing": {
77 | "domainStrategy": "IPOnDemand",
78 | "rules": [
79 | {
80 | "type": "field",
81 | "ip": [
82 | "0.0.0.0/8",
83 | "10.0.0.0/8",
84 | "100.64.0.0/10",
85 | "127.0.0.0/8",
86 | "169.254.0.0/16",
87 | "172.16.0.0/12",
88 | "192.0.0.0/24",
89 | "192.0.2.0/24",
90 | "192.168.0.0/16",
91 | "198.18.0.0/15",
92 | "198.51.100.0/24",
93 | "203.0.113.0/24",
94 | "::1/128",
95 | "fc00::/7",
96 | "fe80::/10",
97 | "geoip:cn"
98 | ],
99 | "domain": [
100 | "geosite:cn"
101 | ],
102 | "outboundTag": "direct"
103 | },
104 | {
105 | "type": "chinasites",
106 | "outboundTag": "direct"
107 | },
108 | {
109 | "type": "chinaip",
110 | "outboundTag": "direct"
111 | }
112 | ]
113 | }
114 | }
--------------------------------------------------------------------------------
/src/uninstall.sh:
--------------------------------------------------------------------------------
1 | while :; do
2 | echo
3 | read -p "$(echo -e "是否卸载 ${yellow}V2Ray$none [${magenta}Y/N$none]:")" uninstall_v2ray_ask
4 | if [[ -z $uninstall_v2ray_ask ]]; then
5 | error
6 | else
7 | case $uninstall_v2ray_ask in
8 | Y | y)
9 | is_uninstall_v2ray=true
10 | echo
11 | echo -e "$yellow 卸载 V2Ray = ${cyan}是${none}"
12 | echo
13 | break
14 | ;;
15 | N | n)
16 | echo
17 | echo -e "$red 卸载已取消...$none"
18 | echo
19 | break
20 | ;;
21 | *)
22 | error
23 | ;;
24 | esac
25 | fi
26 | done
27 |
28 | if [[ $caddy && $is_uninstall_v2ray ]] && [[ -f /usr/local/bin/caddy && -f /etc/caddy/Caddyfile ]]; then
29 | while :; do
30 | echo
31 | read -p "$(echo -e "是否卸载 ${yellow}Caddy$none [${magenta}Y/N$none]:")" uninstall_caddy_ask
32 | if [[ -z $uninstall_caddy_ask ]]; then
33 | error
34 | else
35 | case $uninstall_caddy_ask in
36 | Y | y)
37 | is_uninstall_caddy=true
38 | echo
39 | echo -e "$yellow 卸载 Caddy = ${cyan}是${none}"
40 | echo
41 | break
42 | ;;
43 | N | n)
44 | echo
45 | echo -e "$yellow 卸载 Caddy = ${cyan}否${none}"
46 | echo
47 | break
48 | ;;
49 | *)
50 | error
51 | ;;
52 | esac
53 | fi
54 | done
55 | fi
56 |
57 | if [[ $is_uninstall_v2ray && $is_uninstall_caddy ]]; then
58 | pause
59 | echo
60 |
61 | if [[ $shadowsocks ]]; then
62 | del_port $ssport
63 | fi
64 | if [[ $socks ]]; then
65 | del_port $socks_port
66 | fi
67 | if [[ $mtproto ]]; then
68 | del_port $mtproto_port
69 | fi
70 |
71 | if [[ $v2ray_transport == [45] ]]; then
72 | del_port "80"
73 | del_port "443"
74 | del_port $v2ray_port
75 | elif [[ $v2ray_transport -ge 18 ]]; then
76 | del_port $v2ray_port
77 | del_port "multiport"
78 | else
79 | del_port $v2ray_port
80 | fi
81 |
82 | [ $cmd == "apt-get" ] && rm -rf /etc/network/if-pre-up.d/iptables
83 |
84 | # [ $v2ray_pid ] && systemctl stop v2ray
85 | [ $v2ray_pid ] && do_service stop v2ray
86 |
87 | rm -rf /usr/bin/v2ray
88 | rm -rf $_v2ray_sh
89 | rm -rf /etc/v2ray
90 | rm -rf /var/log/v2ray
91 |
92 | # [ $caddy_pid ] && systemctl stop caddy
93 | [ $caddy_pid ] && do_service stop caddy
94 |
95 | rm -rf /usr/local/bin/caddy
96 | rm -rf /etc/caddy
97 | rm -rf /etc/ssl/caddy
98 |
99 | if [[ $systemd ]]; then
100 | systemctl disable v2ray >/dev/null 2>&1
101 | rm -rf /lib/systemd/system/v2ray.service
102 | systemctl disable caddy >/dev/null 2>&1
103 | rm -rf /lib/systemd/system/caddy.service
104 | else
105 | update-rc.d -f caddy remove >/dev/null 2>&1
106 | update-rc.d -f v2ray remove >/dev/null 2>&1
107 | rm -rf /etc/init.d/caddy
108 | rm -rf /etc/init.d/v2ray
109 | fi
110 | # clear
111 | echo
112 | echo -e "$green V2Ray 卸载完成啦 ....$none"
113 | echo
114 | echo "如果你觉得这个脚本有哪些地方不够好的话...请告诉我"
115 | echo
116 | echo "反馈问题: https://github.com/233boy/v2ray/issues"
117 | echo
118 |
119 | elif [[ $is_uninstall_v2ray ]]; then
120 | pause
121 | echo
122 |
123 | if [[ $shadowsocks ]]; then
124 | del_port $ssport
125 | fi
126 | if [[ $socks ]]; then
127 | del_port $socks_port
128 | fi
129 | if [[ $mtproto ]]; then
130 | del_port $mtproto_port
131 | fi
132 |
133 | if [[ $v2ray_transport == [45] ]]; then
134 | del_port "80"
135 | del_port "443"
136 | del_port $v2ray_port
137 | elif [[ $v2ray_transport -ge 18 ]]; then
138 | del_port $v2ray_port
139 | del_port "multiport"
140 | else
141 | del_port $v2ray_port
142 | fi
143 |
144 | [ $cmd == "apt-get" ] && rm -rf /etc/network/if-pre-up.d/iptables
145 |
146 | # [ $v2ray_pid ] && systemctl stop v2ray
147 | [ $v2ray_pid ] && do_service stop v2ray
148 |
149 | rm -rf /usr/bin/v2ray
150 | rm -rf $_v2ray_sh
151 | rm -rf /etc/v2ray
152 | rm -rf /var/log/v2ray
153 | if [[ $systemd ]]; then
154 | systemctl disable v2ray >/dev/null 2>&1
155 | rm -rf /lib/systemd/system/v2ray.service
156 | else
157 | update-rc.d -f v2ray remove >/dev/null 2>&1
158 | rm -rf /etc/init.d/v2ray
159 | fi
160 | # clear
161 | echo
162 | echo -e "$green V2Ray 卸载完成啦 ....$none"
163 | echo
164 | echo "如果你觉得这个脚本有哪些地方不够好的话...请告诉我"
165 | echo
166 | echo "反馈问题: https://github.com/233boy/v2ray/issues"
167 | echo
168 | fi
169 |
--------------------------------------------------------------------------------
/src/vmess-config.sh:
--------------------------------------------------------------------------------
1 | # config file
2 | case $v2ray_transport in
3 | 1)
4 | v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/tcp.json"
5 | v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/tcp.json"
6 | ;;
7 | 2)
8 | v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/http.json"
9 | v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/http.json"
10 | ;;
11 | 3)
12 | v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/ws.json"
13 | v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/ws.json"
14 | ;;
15 | 4)
16 | v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/ws.json"
17 | v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/ws_tls.json"
18 | ;;
19 | 5)
20 | v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/h2.json"
21 | v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/h2.json"
22 | ;;
23 | [6-9] | 10 | 11)
24 | v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/kcp.json"
25 | v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json"
26 | ;;
27 | 1[2-7])
28 | v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/quic.json"
29 | v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/quic.json"
30 | ;;
31 | 18)
32 | v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/dynamic/tcp.json"
33 | v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/tcp.json"
34 | ;;
35 | 19)
36 | v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/dynamic/http.json"
37 | v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/http.json"
38 | ;;
39 | 20)
40 | v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/dynamic/ws.json"
41 | v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/ws.json"
42 | ;;
43 | 2[1-6])
44 | v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/dynamic/kcp.json"
45 | v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/kcp.json"
46 | ;;
47 | *)
48 | v2ray_server_config_file="/etc/v2ray/233boy/v2ray/config/server/dynamic/quic.json"
49 | v2ray_client_config_file="/etc/v2ray/233boy/v2ray/config/client/quic.json"
50 | ;;
51 | esac
52 |
53 | # copy config file
54 | cp -f $v2ray_server_config_file $v2ray_server_config
55 | cp -f $v2ray_client_config_file $v2ray_client_config
56 |
57 | # change port, uuid, alterId
58 | sed -i "9s/2333/$v2ray_port/; 14s/$old_id/$v2ray_id/; 16s/233/$alterId/" $v2ray_server_config
59 |
60 | # change dynamic port
61 | if [[ $v2ray_transport -ge 18 ]]; then
62 | local multi_port="${v2ray_dynamicPort_start}-${v2ray_dynamicPort_end}"
63 | sed -i "s/10000-20000/$multi_port/" $v2ray_server_config
64 | fi
65 |
66 | # change domain and path, or header type
67 | case $v2ray_transport in
68 | 5)
69 | sed -i "24s/233blog.com/$domain/" $v2ray_server_config
70 | if [[ $is_path ]]; then
71 | sed -i "26s/233blog/$path/" $v2ray_server_config
72 | else
73 | sed -i "26s/233blog//" $v2ray_server_config
74 | fi
75 | ;;
76 | 7 | 13 | 22 | 28)
77 | sed -i "s/none/utp/" $v2ray_server_config
78 | sed -i "s/none/utp/" $v2ray_client_config
79 | ;;
80 | 8 | 14 | 23 | 29)
81 | sed -i "s/none/srtp/" $v2ray_server_config
82 | sed -i "s/none/srtp/" $v2ray_client_config
83 | ;;
84 | 9 | 15 | 24 | 30)
85 | sed -i "s/none/wechat-video/" $v2ray_server_config
86 | sed -i "s/none/wechat-video/" $v2ray_client_config
87 | ;;
88 | 10 | 16 | 25 | 31)
89 | sed -i "s/none/dtls/" $v2ray_server_config
90 | sed -i "s/none/dtls/" $v2ray_client_config
91 | ;;
92 | 11 | 17 | 26 | 32)
93 | sed -i "s/none/wireguard/" $v2ray_server_config
94 | sed -i "s/none/wireguard/" $v2ray_client_config
95 | ;;
96 | esac
97 |
98 | ## change client config file
99 | [[ -z $ip ]] && get_ip
100 | if [[ $v2ray_transport == [45] ]]; then
101 | sed -i "s/233blog.com/$domain/; 13s/2333/443/; 16s/$old_id/$v2ray_id/; 17s/233/$alterId/" $v2ray_client_config
102 | if [[ $is_path ]]; then
103 | sed -i "31s/233blog/$path/" $v2ray_client_config
104 | else
105 | sed -i "31s/233blog//" $v2ray_client_config
106 | fi
107 | else
108 | sed -i "s/233blog.com/$ip/; 13s/2333/$v2ray_port/; 16s/$old_id/$v2ray_id/; 17s/233/$alterId/" $v2ray_client_config
109 | fi
110 |
111 | # zip -q -r -j --password "233blog.com" /etc/v2ray/233blog_v2ray.zip $v2ray_client_config
112 |
--------------------------------------------------------------------------------
/config/server/dynamic/http.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "access": "/var/log/v2ray/access.log",
4 | "error": "/var/log/v2ray/error.log",
5 | "loglevel": "warning"
6 | },
7 | "inbounds": [
8 | {
9 | "port": 2333,
10 | "protocol": "vmess",
11 | "settings": {
12 | "clients": [
13 | {
14 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
15 | "level": 1,
16 | "alterId": 233
17 | }
18 | ],
19 | "detour": {
20 | "to": "dynamic"
21 | }
22 | },
23 | "streamSettings": {
24 | "network": "tcp",
25 | "tcpSettings": {
26 | "header": {
27 | "type": "http"
28 | }
29 | }
30 | },
31 | "sniffing": {
32 | "enabled": true,
33 | "destOverride": [
34 | "http",
35 | "tls"
36 | ]
37 | }
38 | },
39 | {
40 | "protocol": "vmess",
41 | "port": "10000-20000",
42 | "tag": "dynamic",
43 | "settings": {
44 | "default": {
45 | "level": 1,
46 | "alterId": 32
47 | }
48 | },
49 | "allocate": {
50 | "strategy": "random",
51 | "concurrency": 2,
52 | "refresh": 5
53 | },
54 | "streamSettings": {
55 | "network": "tcp",
56 | "tcpSettings": {
57 | "header": {
58 | "type": "http",
59 | "response": {
60 | "version": "1.1",
61 | "status": "200",
62 | "reason": "OK",
63 | "headers": {
64 | "Content-encoding": [
65 | "gzip"
66 | ],
67 | "Content-Type": [
68 | "text/html; charset=utf-8"
69 | ],
70 | "Cache-Control": [
71 | "no-cache"
72 | ],
73 | "Vary": [
74 | "Accept-Encoding"
75 | ],
76 | "X-Frame-Options": [
77 | "deny"
78 | ],
79 | "X-XSS-Protection": [
80 | "1; mode=block"
81 | ],
82 | "X-content-type-options": [
83 | "nosniff"
84 | ]
85 | }
86 | }
87 | }
88 | }
89 | }
90 | }
91 | //include_ss
92 | //include_socks
93 | //include_mtproto
94 | //include_config
95 | //
96 | ],
97 | "outbounds": [
98 | {
99 | "protocol": "freedom",
100 | "settings": {}
101 | },
102 | {
103 | "protocol": "blackhole",
104 | "settings": {},
105 | "tag": "blocked"
106 | },
107 | {
108 | "protocol": "freedom",
109 | "settings": {},
110 | "tag": "direct"
111 | },
112 | {
113 | "protocol": "mtproto",
114 | "settings": {},
115 | "tag": "tg-out"
116 | }
117 | ],
118 | "dns": {
119 | "server": [
120 | "8.8.8.8",
121 | "8.8.4.4",
122 | "1.1.1.1",
123 | "1.0.0.1",
124 | "localhost"
125 | ]
126 | },
127 | "routing": {
128 | "domainStrategy": "IPOnDemand",
129 | "rules": [
130 | {
131 | "type": "field",
132 | "ip": [
133 | "0.0.0.0/8",
134 | "10.0.0.0/8",
135 | "100.64.0.0/10",
136 | "127.0.0.0/8",
137 | "169.254.0.0/16",
138 | "172.16.0.0/12",
139 | "192.0.0.0/24",
140 | "192.0.2.0/24",
141 | "192.168.0.0/16",
142 | "198.18.0.0/15",
143 | "198.51.100.0/24",
144 | "203.0.113.0/24",
145 | "::1/128",
146 | "fc00::/7",
147 | "fe80::/10"
148 | ],
149 | "outboundTag": "blocked"
150 | },
151 | {
152 | "type": "field",
153 | "inboundTag": ["tg-in"],
154 | "outboundTag": "tg-out"
155 | }
156 | //include_ban_xx
157 | //include_ban_bt
158 | //include_ban_ad
159 | //include_rules
160 | //
161 | ]
162 | },
163 | "transport": {
164 | "kcpSettings": {
165 | "uplinkCapacity": 100,
166 | "downlinkCapacity": 100,
167 | "congestion": true
168 | },
169 | "sockopt": {
170 | "tcpFastOpen": true
171 | }
172 | }
173 | }
--------------------------------------------------------------------------------
/config/client/http.json:
--------------------------------------------------------------------------------
1 | {
2 | "log": {
3 | "error": "error.log",
4 | "loglevel": "warning"
5 | },
6 | "outbounds": [
7 | {
8 | "protocol": "vmess",
9 | "settings": {
10 | "vnext": [
11 | {
12 | "address": "233blog.com",
13 | "port": 2333,
14 | "users": [
15 | {
16 | "id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
17 | "alterId": 233,
18 | "security": "auto"
19 | }
20 | ]
21 | }
22 | ]
23 | },
24 | "streamSettings": {
25 | "network": "tcp",
26 | "tcpSettings": {
27 | "header": {
28 | "type": "http",
29 | "request": {
30 | "version": "1.1",
31 | "method": "GET",
32 | "path": [
33 | "/"
34 | ],
35 | "headers": {
36 | "Host": [
37 | "www.cloudflare.com",
38 | "www.amazon.com"
39 | ],
40 | "User-Agent": [
41 | "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",
42 | "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36",
43 | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36",
44 | "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0"
45 | ],
46 | "Accept": [
47 | "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
48 | ],
49 | "Accept-language": [
50 | "zh-CN,zh;q=0.8,en-US;q=0.6,en;q=0.4"
51 | ],
52 | "Accept-Encoding": [
53 | "gzip, deflate, br"
54 | ],
55 | "Cache-Control": [
56 | "no-cache"
57 | ],
58 | "Pragma": "no-cache"
59 | }
60 | }
61 | }
62 | }
63 | },
64 | "mux": {
65 | "enabled": true
66 | }
67 | },
68 | {
69 | "protocol": "freedom",
70 | "settings": {},
71 | "tag": "direct"
72 | }
73 | ],
74 | "inbounds": [
75 | {
76 | "port": 2333,
77 | "listen": "127.0.0.1",
78 | "protocol": "socks",
79 | "settings": {
80 | "auth": "noauth",
81 | "udp": true,
82 | "ip": "127.0.0.1"
83 | }
84 | },
85 | {
86 | "port": 6666,
87 | "listen": "127.0.0.1",
88 | "protocol": "http",
89 | "settings": {
90 | "auth": "noauth",
91 | "udp": true,
92 | "ip": "127.0.0.1"
93 | }
94 | }
95 | ],
96 | "dns": {
97 | "servers": [
98 | "8.8.8.8",
99 | "8.8.4.4",
100 | "localhost"
101 | ]
102 | },
103 | "routing": {
104 | "domainStrategy": "IPOnDemand",
105 | "rules": [
106 | {
107 | "type": "field",
108 | "ip": [
109 | "0.0.0.0/8",
110 | "10.0.0.0/8",
111 | "100.64.0.0/10",
112 | "127.0.0.0/8",
113 | "169.254.0.0/16",
114 | "172.16.0.0/12",
115 | "192.0.0.0/24",
116 | "192.0.2.0/24",
117 | "192.168.0.0/16",
118 | "198.18.0.0/15",
119 | "198.51.100.0/24",
120 | "203.0.113.0/24",
121 | "::1/128",
122 | "fc00::/7",
123 | "fe80::/10",
124 | "geoip:cn"
125 | ],
126 | "domain": [
127 | "geosite:cn"
128 | ],
129 | "outboundTag": "direct"
130 | },
131 | {
132 | "type": "chinasites",
133 | "outboundTag": "direct"
134 | },
135 | {
136 | "type": "chinaip",
137 | "outboundTag": "direct"
138 | }
139 | ]
140 | }
141 | }
--------------------------------------------------------------------------------
/src/mtproto.sh:
--------------------------------------------------------------------------------
1 | _view_mtproto_info() {
2 | if [[ $mtproto ]]; then
3 | _mtproto_info
4 | else
5 | _mtproto_ask
6 | fi
7 | }
8 | _mtproto_info() {
9 | [[ -z $ip ]] && get_ip
10 | echo
11 | echo "---------- Telegram MTProto 配置信息 -------------"
12 | echo
13 | echo -e "$yellow 主机 (Hostname) = $cyan${ip}$none"
14 | echo
15 | echo -e "$yellow 端口 (Port) = $cyan$mtproto_port$none"
16 | echo
17 | echo -e "$yellow 密钥 (Secret) = $cyan$mtproto_secret$none"
18 | echo
19 | echo -e "$yellow Telegram 代理配置链接 = ${cyan}https://t.me/proxy?server=${ip}&port=${mtproto_port}&secret=${mtproto_secret}$none"
20 | echo
21 | }
22 | _mtproto_main() {
23 | if [[ $mtproto ]]; then
24 |
25 | while :; do
26 | echo
27 | echo -e "$yellow 1. $none查看 Telegram MTProto 配置信息"
28 | echo
29 | echo -e "$yellow 2. $none修改 Telegram MTProto 端口"
30 | echo
31 | echo -e "$yellow 3. $none修改 Telegram MTProto 密钥"
32 | echo
33 | echo -e "$yellow 4. $none关闭 Telegram MTProto"
34 | echo
35 | read -p "$(echo -e "请选择 [${magenta}1-4$none]:")" _opt
36 | if [[ -z $_opt ]]; then
37 | error
38 | else
39 | case $_opt in
40 | 1)
41 | _mtproto_info
42 | break
43 | ;;
44 | 2)
45 | change_mtproto_port
46 | break
47 | ;;
48 | 3)
49 | change_mtproto_secret
50 | break
51 | ;;
52 | 4)
53 | disable_mtproto
54 | break
55 | ;;
56 | *)
57 | error
58 | ;;
59 | esac
60 | fi
61 |
62 | done
63 | else
64 | _mtproto_ask
65 | fi
66 | }
67 | _mtproto_ask() {
68 | echo
69 | echo
70 | echo -e " $red大佬...你没有配置 Telegram MTProto $none...不过现在想要配置的话也是可以的 ^_^"
71 | echo
72 | echo
73 | new_mtproto_secret="dd$(date | md5sum | cut -c-30)"
74 | while :; do
75 | echo -e "是否配置 ${yellow}Telegram MTProto${none} [${magenta}Y/N$none]"
76 | read -p "$(echo -e "(默认 [${cyan}N$none]):") " new_mtproto
77 | [[ -z "$new_mtproto" ]] && new_mtproto="n"
78 | if [[ "$new_mtproto" == [Yy] ]]; then
79 | echo
80 | mtproto=true
81 | mtproto_port_config
82 | pause
83 | open_port $new_mtproto_port
84 | backup_config +mtproto
85 | mtproto_port=$new_mtproto_port
86 | mtproto_secret=$new_mtproto_secret
87 | config
88 | clear
89 | _mtproto_info
90 | break
91 | elif [[ "$new_mtproto" == [Nn] ]]; then
92 | echo
93 | echo -e " $green已取消配置 Telegram MTProto ....$none"
94 | echo
95 | break
96 | else
97 | error
98 | fi
99 |
100 | done
101 | }
102 | disable_mtproto() {
103 | echo
104 |
105 | while :; do
106 | echo -e "是否关闭 ${yellow}Telegram MTProto${none} [${magenta}Y/N$none]"
107 | read -p "$(echo -e "(默认 [${cyan}N$none]):") " y_n
108 | [[ -z "$y_n" ]] && y_n="n"
109 | if [[ "$y_n" == [Yy] ]]; then
110 | echo
111 | echo
112 | echo -e "$yellow 关闭 Telegram MTProto = $cyan是$none"
113 | echo "----------------------------------------------------------------"
114 | echo
115 | pause
116 | backup_config -mtproto
117 | del_port $mtproto_port
118 | mtproto=''
119 | config
120 | echo
121 | echo
122 | echo
123 | echo -e "$green Telegram MTProto 已关闭...不过你也可以随时重新启用 Telegram MTProto ...只要你喜欢$none"
124 | echo
125 | break
126 | elif [[ "$y_n" == [Nn] ]]; then
127 | echo
128 | echo -e " $green已取消关闭 Telegram MTProto ....$none"
129 | echo
130 | break
131 | else
132 | error
133 | fi
134 |
135 | done
136 | }
137 | mtproto_port_config() {
138 | local random=$(shuf -i20001-65535 -n1)
139 | echo
140 | while :; do
141 | echo -e "请输入 "$yellow"Telegram MTProto"$none" 端口 ["$magenta"1-65535"$none"],不能和 "$yellow"V2Ray"$none" 端口相同"
142 | read -p "$(echo -e "(默认端口: ${cyan}${random}$none):") " new_mtproto_port
143 | [ -z "$new_mtproto_port" ] && new_mtproto_port=$random
144 | case $new_mtproto_port in
145 | $v2ray_port)
146 | echo
147 | echo " 不能和 V2Ray 端口一毛一样...."
148 | error
149 | ;;
150 | [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])
151 | if [[ $v2ray_transport == [45] ]]; then
152 | local tls=ture
153 | fi
154 | if [[ $tls && $new_mtproto_port == "80" ]] || [[ $tls && $new_mtproto_port == "443" ]]; then
155 | echo
156 | echo -e "由于你已选择了 "$green"WebSocket + TLS $none或$green HTTP/2"$none" 传输协议."
157 | echo
158 | echo -e "所以不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
159 | error
160 | elif [[ $dynamicPort ]] && [[ $v2ray_dynamicPort_start == $new_mtproto_port || $v2ray_dynamicPort_end == $new_mtproto_port ]]; then
161 | echo
162 | echo -e " 抱歉,此端口和 V2Ray 动态端口 冲突,当前 V2Ray 动态端口范围为:${cyan}$port_range${none}"
163 | error
164 | elif [[ $dynamicPort ]] && [[ $v2ray_dynamicPort_start -lt $new_mtproto_port && $new_mtproto_port -le $v2ray_dynamicPort_end ]]; then
165 | echo
166 | echo -e " 抱歉,此端口和 V2Ray 动态端口 冲突,当前 V2Ray 动态端口范围为:${cyan}$port_range${none}"
167 | error
168 | elif [[ $shadowsocks && $new_mtproto_port == $ssport ]]; then
169 | echo
170 | echo -e "抱歉, 此端口跟 Shadowsocks 端口冲突...当前 Shadowsocks 端口: ${cyan}$ssport$none"
171 | error
172 | elif [[ $socks && $new_mtproto_port == $socks_port ]]; then
173 | echo
174 | echo -e "抱歉, 此端口跟 Socks 端口冲突...当前 Socks 端口: ${cyan}$socks_port$none"
175 | error
176 | else
177 | echo
178 | echo
179 | echo -e "$yellow Telegram MTProto 端口 = $cyan$new_mtproto_port$none"
180 | echo "----------------------------------------------------------------"
181 | echo
182 | break
183 | fi
184 | ;;
185 | *)
186 | error
187 | ;;
188 | esac
189 |
190 | done
191 |
192 | }
193 | change_mtproto_secret() {
194 | new_mtproto_secret="dd$(date | md5sum | cut -c-30)"
195 | echo
196 | while :; do
197 | read -p "$(echo -e "是否更改 ${yellow}Telegram MTProto 密钥${none} [${magenta}Y/N$none]"): " y_n
198 | [ -z "$y_n" ] && error && continue
199 | case $y_n in
200 | n | N)
201 | echo
202 | echo -e " 已取消更改.... "
203 | echo
204 | break
205 | ;;
206 | y | Y)
207 | echo
208 | echo
209 | echo -e "$yellow 更改 Telegram MTProto 密钥 = $cyan是$none"
210 | echo "----------------------------------------------------------------"
211 | echo
212 | pause
213 | backup_config mtproto_secret
214 | mtproto_secret=$new_mtproto_secret
215 | config
216 | clear
217 | _mtproto_info
218 | break
219 | ;;
220 | esac
221 | done
222 | }
223 | change_mtproto_port() {
224 | echo
225 | while :; do
226 | echo -e "请输入新的 "$yellow"Telegram MTProto"$none" 端口 ["$magenta"1-65535"$none"]"
227 | read -p "$(echo -e "(当前端口: ${cyan}${mtproto_port}$none):") " new_mtproto_port
228 | [ -z "$new_mtproto_port" ] && error && continue
229 | case $new_mtproto_port in
230 | $mtproto_port)
231 | echo
232 | echo " 不能跟当前端口一毛一样...."
233 | error
234 | ;;
235 | $v2ray_port)
236 | echo
237 | echo " 不能和 V2Ray 端口一毛一样...."
238 | error
239 | ;;
240 | [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])
241 | if [[ $v2ray_transport == [45] ]]; then
242 | local tls=ture
243 | fi
244 | if [[ $tls && $new_mtproto_port == "80" ]] || [[ $tls && $new_mtproto_port == "443" ]]; then
245 | echo
246 | echo -e "由于你已选择了 "$green"WebSocket + TLS $none或$green HTTP/2"$none" 传输协议."
247 | echo
248 | echo -e "所以不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
249 | error
250 | elif [[ $dynamicPort ]] && [[ $v2ray_dynamicPort_start == $new_mtproto_port || $v2ray_dynamicPort_end == $new_mtproto_port ]]; then
251 | echo
252 | echo -e " 抱歉,此端口和 V2Ray 动态端口 冲突,当前 V2Ray 动态端口范围为:${cyan}$port_range${none}"
253 | error
254 | elif [[ $dynamicPort ]] && [[ $v2ray_dynamicPort_start -lt $new_mtproto_port && $new_mtproto_port -le $v2ray_dynamicPort_end ]]; then
255 | echo
256 | echo -e " 抱歉,此端口和 V2Ray 动态端口 冲突,当前 V2Ray 动态端口范围为:${cyan}$port_range${none}"
257 | error
258 | elif [[ $shadowsocks && $new_mtproto_port == $ssport ]]; then
259 | echo
260 | echo -e "抱歉, 此端口跟 Shadowsocks 端口冲突...当前 Shadowsocks 端口: ${cyan}$ssport$none"
261 | error
262 | elif [[ $socks && $new_mtproto_port == $socks_port ]]; then
263 | echo
264 | echo -e "抱歉, 此端口跟 Socks 端口冲突...当前 Socks 端口: ${cyan}$socks_port$none"
265 | error
266 | else
267 | echo
268 | echo
269 | echo -e "$yellow socks 端口 = $cyan$new_mtproto_port$none"
270 | echo "----------------------------------------------------------------"
271 | echo
272 | pause
273 | backup_config mtproto_port
274 | mtproto_port=$new_mtproto_port
275 | config
276 | clear
277 | _mtproto_info
278 | break
279 | fi
280 | ;;
281 | *)
282 | error
283 | ;;
284 | esac
285 |
286 | done
287 |
288 | }
289 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
支持 V2Ray 绝大多数传输协议,WebSocket + TLS,HTTP/2,Shadowsocks,动态端口,集成 BBR 和锐速优化等。
3 |
4 |
前言
5 |
6 |
V2Ray 官网:https://www.v2ray.com
7 |
8 |
V2Ray 是一个于 Shadowsocks 之后非常好用的代理软件,但是由于 V2Ray 的配置略复杂,GUI 客户端不完善,所以 V2Ray 并没有像 Shadowsocks 在科学上网人群之中那么流行。
9 | 不过我想,像我这种小小白萌新,更需要的是一个好用的一键安装脚本……
10 | 所以,此脚本是为了方便像我这种小小白萌新更加容易去使用 V2Ray,配置 V2Ray。希望对你有帮助 ^_^
11 |
12 |
13 | 如果你是毫无经验的小白,搭建 V2Ray 请看此教程:V2Ray搭建详细图文教程
14 |
15 |
16 |
更新日志
17 |
18 |
19 | - 2018-01-28
20 | 第一个完善版本发布…
21 | - 2018-5-2
22 | 支持 HTTP/2 … 懒得发一个版本就在这里写一下
23 | - 2018-5-26
24 | 支持 Socks5 …
25 | - 2019-1-5
26 | v3.05 版本,更加好用了。新年快乐!
27 |
28 |
29 |
30 |
温馨提示
31 |
32 |
特么这个脚本没有挖矿,没有挖矿,没有挖矿。 我很抱歉……认真的开了个玩笑
33 | 脚本是开源的,开源地址: https://github.com/233boy/v2ray
34 |
35 |
功能特点
36 |
37 |
38 | - 支持 V2Ray 多数传输协议
39 | - 支持 WebSocket + TLS / HTTP/2
40 | - 支持 动态端口 (WebSocket + TLS,Socks5, HTTP/2 除外)
41 | - 支持 屏蔽广告
42 | - 支持 配置 Shadowsocks
43 | - 支持 下载客户端配置文件 (不用 Xshell 也可以下载)
44 | - 客户端配置文件同时支持 SOCKS 和 HTTP
45 | - 支持 生成 V2Ray 配置二维码链接 (仅适用部分客户端)
46 | - 支持 生成 V2Ray 配置信息链接
47 | - 支持 生成 Shadowsocks 配置二维码链接
48 | - 支持修改 V2Ray 传输协议
49 | - 支持修改 V2Ray 端口
50 | - 支持修改 动态端口
51 | - 支持修改 用户ID
52 | - 支持修改 TLS 域名
53 | - 支持修改 Shadowsocks 端口
54 | - 支持修改 Shadowsocks 密码
55 | - 支持修改 Shadowsocks 加密协议
56 | - 自动启用 BBR 优化 (如果内核支持)
57 | - 集成可选安装 BBR (by teddysun.com)
58 | - 集成可选安装 锐速 (by moeclub.org)
59 | - 一键 查看运行状态 / 查看配置信息 / 启动 / 停止 / 重启 / 更新 / 卸载 / 等等…
60 | - 人性化向导 & 纯净安装 & 卸载彻底
61 |
62 |
63 |
64 |
哈哈哈..我故意要写够 23 条的。说着当然,脚本肯定都会有如上所说的功能。
65 |
66 |
安装或卸载
67 |
68 |
69 | 温馨提醒,此脚本默认屏蔽一些不友好的网站!(仅限轮子相关)
70 |
71 |
72 |
要求:Ubuntu 16+ / Debian 8+ / CentOS 7+ 系统
73 | 推荐使用 Debian 9 系统,脚本会自动启用 BBR 优化。
74 | 备注:不推荐使用 Debian 8 系统,因为 Caddy 申请证书可能会出现一些莫名其妙的问题
75 | 强烈推荐使用 搬瓦工VPS,稳定,快速,针对中国线路专门优化,完全无须担心跑路,服务好,30天退款保证。
76 | 在这里可以找到
77 | 搬瓦工 VPS 套餐大全
78 |
79 | ,优惠码在这里:
80 | 搬瓦工 VPS 优惠码
81 |
82 |
83 | 使用 root 用户输入下面命令安装或卸载
84 |
85 |
bash <(curl -s -L https://git.io/v2ray.sh)
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | 如果提示 curl: command not found ,那是因为你的 VPS 没装 Curl
97 | ubuntu/debian 系统安装 Curl 方法: apt-get update -y && apt-get install curl -y
98 | centos 系统安装 Curl 方法: yum update -y && yum install curl -y
99 | 安装好 curl 之后就能安装脚本了
100 |
101 |
102 |
备注:安装完成后,输入 v2ray 即可管理 V2Ray
103 | 如果提示你的系统不支持此脚本,那么请尝试更换系统
104 |
105 |
下面是此脚本的一些截图
106 |
107 |
安装选项
108 |
109 |
110 |

111 |
112 |
113 |
配置 Shadowsocks
114 |
115 |
116 |

117 |
118 |
119 |
安装完成
120 |
121 |
122 |

123 |
124 |
125 |
管理面板
126 |
127 |
128 |

129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
Telegram 专用代理
139 |
140 |
如果你在使用 Telegram 的话,你可以配置一个 Telegram 的专用代理,这样来,在某些情况下你就不需要再开一个代理软件了。
141 | 输入 v2ray tg 即可配置 TG 专用代理
142 | 配置 Telegram MTProto
143 |
144 |
145 |

146 |
147 |
148 |
Telegram MTProto 配置信息
149 |
150 |
151 |

152 |
153 |
154 |
快速管理
155 |
156 |
v2ray info 查看 V2Ray 配置信息
157 | v2ray config 修改 V2Ray 配置
158 | v2ray link 生成 V2Ray 配置文件链接
159 | v2ray infolink 生成 V2Ray 配置信息链接
160 | v2ray qr 生成 V2Ray 配置二维码链接
161 | v2ray ss 修改 Shadowsocks 配置
162 | v2ray ssinfo 查看 Shadowsocks 配置信息
163 | v2ray ssqr 生成 Shadowsocks 配置二维码链接
164 | v2ray status 查看 V2Ray 运行状态
165 | v2ray start 启动 V2Ray
166 | v2ray stop 停止 V2Ray
167 | v2ray restart 重启 V2Ray
168 | v2ray log 查看 V2Ray 运行日志
169 | v2ray update 更新 V2Ray
170 | v2ray update.sh 更新 V2Ray 管理脚本
171 | v2ray uninstall 卸载 V2Ray
172 |
173 |
配置文件路径
174 |
175 |
V2Ray 配置文件路径:/etc/v2ray/config.json
176 | Caddy 配置文件路径:/etc/caddy/Caddyfile
177 | 脚本配置文件路径: /etc/v2ray/233blog_v2ray_backup.conf
178 |
179 |
180 | 警告,请不要修改脚本配置文件,免得出错。。
181 | 如果你不是有特别的需求,也不要修改 V2Ray 配置文件
182 | 不过也没事,若你实在想要瞎折腾,出错了的话,你就卸载,然后重装,再出错 ,再卸载,再重装,重复到自己不再想折腾为止。。
183 |
184 |
185 |
WS+TLS / HTTP2
186 |
187 |
如果你使用了这两个协议,那么就会使用了脚本自带的 Caddy 集成
188 | 不管如何,不建议直接去更改 Caddy 的配置:/etc/caddy/Caddyfile
189 | 如果你需要配置其他网站相关,请将网站的配置文件放到 /etc/caddy/sites 目录下,然后重启 Caddy 进程即可,脚本默认生成的 Caddy 的配置会加载 /etc/caddy/sites 这个目录下的所有配置文件。
190 | 所以,请将你的网站配置文件放到 /etc/caddy/sites 目录下,完完全全不需要去更改 /etc/caddy/Caddyfile
191 | 记得重启 Caddy 进程:service caddy restart
192 |
193 |
Caddy 插件相关
194 |
195 |
本脚本集成了 Caddy,但不集成任何 Caddy 插件,如果你需要安装某些 Caddy 插件,你可以使用官方的 Caddy 安装脚本来一键安装。
196 | 本人的脚本集成的 Caddy 的安装路径,跟 Caddy 官方的安装脚本是一致的。所以可以直接安装,不会有任何问题
197 |
198 |
举个例子,安装包含 http.filebrowser 插件的 Caddy,执行如下命令即可
199 |
200 |
curl https://getcaddy.com | bash -s personal http.filebrowser
201 |
202 |
203 |
你可以在 https://caddyserver.com/download 找到 Caddy 更多插件和安装命令。
204 |
205 |
备注
206 |
207 |
V2Ray 客户端配置文件 SOCKS 监听端口为 2333, HTTP 监听端口为 6666
208 | 可能某些 V2Ray 客户端的选项或描述略有不同,但事实上,此脚本显示的 V2Ray 配置信息已经足够详细,由于客户端的不同,请对号入座。
209 |
210 |
反馈问题
211 |
212 |
请先查阅:V2Ray 一键安装脚本疑问集合
213 | Telegram 群组:
214 | https://t.me/blog233
215 |
216 |
217 | Github 反馈:
218 | https://github.com/233boy/v2ray/issues
219 |
220 |
221 | 任何有关于 V2Ray 的问题,请自行到 V2Ray 官方反馈。
222 | 目前只支持配置一个 V2Ray 账号…一个 Shadowsocks 账号。。不支持 SSR。。
223 | 使用国际大厂的 VPS,请自行在安全组 (防火墙) 开放端口和 UDP 协议 (如果你要使用含有 mKCP 的传输协议)
224 |
225 |
备份
226 |
227 |
为了避免由于不可抗拒的原因所造成本人主动删除脚本,所以建议请将本脚本 Fork 一份
228 | 备份地址:
229 | https://github.com/233boy/v2ray/fork
230 |
231 |
232 | 安装方法,确保你已经 Fork 了脚本,将 233boy 修改成你的 Github 用户名
233 |
234 |
git clone https://github.com/233boy/v2ray
235 | cd v2ray
236 | chmod +x install.sh
237 | ./install.sh local
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
如果提示 git 命令不可用,那就自己安装咯,不会安装啊?我也不知道啊。哈哈
248 |
249 |
及时更新脚本
250 |
251 |
为确保你能愉快使用,请留意使用 v2ray update.sh 命令来更新管理脚本。
252 | 脚本难免会有 BUG,所以建议有空就检查一下更新情况。
253 |
254 |
关注脚本最新动态
255 |
256 |
本人会在 本站 Telegram 公告频道 推送脚本最新动态相关,如果你使用 Telegram 的话,可以关注一下。
257 | 当然啦,你也可以加入 本站 Telegram 群组 来吹水。
258 |
259 |
资助 V2Ray
260 |
261 |
如果你觉得 V2Ray 很好用,能解决你的某些问题,请考虑
262 | 资助 V2Ray 发展
263 |
264 | 。
265 |
266 |
感谢
267 |
268 |
V2Ray:
269 | https://www.v2ray.com/
270 |
271 |
272 |
273 |
版权
274 |
275 |
此脚本使用 GPL v3 协议共享。
276 |
277 |
分享
278 |
279 |
如果觉得脚本好用,记得分享给你的其他小伙伴们哦~
280 |
281 |
其他
282 |
283 |
请勿违反国家法律法规,否则后果自负!
284 | 使用一键脚本并不会害了你,并且会让你节省大量的时间,工具从来都是为了更快的解决问题。
285 |
286 |

287 |
--------------------------------------------------------------------------------
/src/socks.sh:
--------------------------------------------------------------------------------
1 | _view_socks_info() {
2 | if [[ $socks ]]; then
3 | _socks_info
4 | else
5 | _socks_ask
6 | fi
7 | }
8 | _socks_info() {
9 | [[ -z $ip ]] && get_ip
10 | echo
11 | echo "---------- Socks 配置信息 -------------"
12 | echo
13 | echo -e "$yellow 主机 (Hostname) = $cyan${ip}$none"
14 | echo
15 | echo -e "$yellow 端口 (Port) = $cyan$socks_port$none"
16 | echo
17 | echo -e "$yellow 用户名 (Username) = $cyan$socks_username$none"
18 | echo
19 | echo -e "$yellow 密码 (Password) = $cyan$socks_userpass$none"
20 | echo
21 | echo -e "$yellow Telegram 代理配置链接 = ${cyan}tg://socks?server=${ip}&port=${socks_port}&user=${socks_username}&pass=${socks_userpass}$none"
22 | echo
23 | }
24 | _socks_main() {
25 | if [[ $socks ]]; then
26 |
27 | while :; do
28 | echo
29 | echo -e "$yellow 1. $none查看 Socks 配置信息"
30 | echo
31 | echo -e "$yellow 2. $none修改 Socks 端口"
32 | echo
33 | echo -e "$yellow 3. $none修改 Socks 用户名"
34 | echo
35 | echo -e "$yellow 4. $none修改 Socks 密码"
36 | echo
37 | echo -e "$yellow 5. $none关闭 Socks"
38 | echo
39 | read -p "$(echo -e "请选择 [${magenta}1-4$none]:")" _opt
40 | if [[ -z $_opt ]]; then
41 | error
42 | else
43 | case $_opt in
44 | 1)
45 | _socks_info
46 | break
47 | ;;
48 | 2)
49 | change_socks_port_config
50 | break
51 | ;;
52 | 3)
53 | change_socks_user_config
54 | break
55 | ;;
56 | 4)
57 | change_socks_pass_config
58 | break
59 | ;;
60 | 5)
61 | disable_socks
62 | break
63 | ;;
64 | *)
65 | error
66 | ;;
67 | esac
68 | fi
69 |
70 | done
71 | else
72 | _socks_ask
73 | fi
74 | }
75 | _socks_ask() {
76 | echo
77 | echo
78 | echo -e " $red大佬...你没有配置 Socks $none...不过现在想要配置的话也是可以的 ^_^"
79 | echo
80 | echo
81 |
82 | while :; do
83 | echo -e "是否配置 ${yellow}Socks${none} [${magenta}Y/N$none]"
84 | read -p "$(echo -e "(默认 [${cyan}N$none]):") " new_socks
85 | [[ -z "$new_socks" ]] && new_socks="n"
86 | if [[ "$new_socks" == [Yy] ]]; then
87 | echo
88 | socks=true
89 | socks_port_config
90 | socks_user_config
91 | socks_pass_config
92 | pause
93 | open_port $new_socks_port
94 | backup_config +socks
95 | socks_port=$new_socks_port
96 | socks_username=$new_socks_username
97 | socks_userpass=$new_socks_userpass
98 | config
99 | clear
100 | _socks_info
101 | break
102 | elif [[ "$new_socks" == [Nn] ]]; then
103 | echo
104 | echo -e " $green已取消配置 Socks ....$none"
105 | echo
106 | break
107 | else
108 | error
109 | fi
110 |
111 | done
112 | }
113 | disable_socks() {
114 | echo
115 |
116 | while :; do
117 | echo -e "是否关闭 ${yellow}Socks${none} [${magenta}Y/N$none]"
118 | read -p "$(echo -e "(默认 [${cyan}N$none]):") " y_n
119 | [[ -z "$y_n" ]] && y_n="n"
120 | if [[ "$y_n" == [Yy] ]]; then
121 | echo
122 | echo
123 | echo -e "$yellow 关闭 Socks = $cyan是$none"
124 | echo "----------------------------------------------------------------"
125 | echo
126 | pause
127 | backup_config -socks
128 | del_port $socks_port
129 | socks=''
130 | config
131 | echo
132 | echo
133 | echo
134 | echo -e "$green Socks 已关闭...不过你也可以随时重新启用 Socks ...只要你喜欢$none"
135 | echo
136 | break
137 | elif [[ "$y_n" == [Nn] ]]; then
138 | echo
139 | echo -e " $green已取消关闭 Socks ....$none"
140 | echo
141 | break
142 | else
143 | error
144 | fi
145 |
146 | done
147 | }
148 | socks_port_config() {
149 | local random=$(shuf -i20001-65535 -n1)
150 | echo
151 | while :; do
152 | echo -e "请输入 "$yellow"Socks"$none" 端口 ["$magenta"1-65535"$none"],不能和 "$yellow"V2Ray"$none" 端口相同"
153 | read -p "$(echo -e "(默认端口: ${cyan}${random}$none):") " new_socks_port
154 | [ -z "$new_socks_port" ] && new_socks_port=$random
155 | case $new_socks_port in
156 | $v2ray_port)
157 | echo
158 | echo " 不能和 V2Ray 端口一毛一样...."
159 | error
160 | ;;
161 | [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])
162 | if [[ $v2ray_transport == [45] ]]; then
163 | local tls=ture
164 | fi
165 | if [[ $tls && $new_socks_port == "80" ]] || [[ $tls && $new_socks_port == "443" ]]; then
166 | echo
167 | echo -e "由于你已选择了 "$green"WebSocket + TLS $none或$green HTTP/2"$none" 传输协议."
168 | echo
169 | echo -e "所以不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
170 | error
171 | elif [[ $dynamicPort ]] && [[ $v2ray_dynamicPort_start == $new_socks_port || $v2ray_dynamicPort_end == $new_socks_port ]]; then
172 | echo
173 | echo -e " 抱歉,此端口和 V2Ray 动态端口 冲突,当前 V2Ray 动态端口范围为:${cyan}$port_range${none}"
174 | error
175 | elif [[ $dynamicPort ]] && [[ $v2ray_dynamicPort_start -lt $new_socks_port && $new_socks_port -le $v2ray_dynamicPort_end ]]; then
176 | echo
177 | echo -e " 抱歉,此端口和 V2Ray 动态端口 冲突,当前 V2Ray 动态端口范围为:${cyan}$port_range${none}"
178 | error
179 | elif [[ $shadowsocks && $new_socks_port == $ssport ]]; then
180 | echo
181 | echo -e "抱歉, 此端口跟 Shadowsocks 端口冲突...当前 Shadowsocks 端口: ${cyan}$ssport$none"
182 | error
183 | elif [[ $mtproto && $new_socks_port == $mtproto_port ]]; then
184 | echo
185 | echo -e "抱歉, 此端口跟 MTProto 端口冲突...当前 MTProto 端口: ${cyan}$mtproto_port$none"
186 | error
187 | else
188 | echo
189 | echo
190 | echo -e "$yellow Socks 端口 = $cyan$new_socks_port$none"
191 | echo "----------------------------------------------------------------"
192 | echo
193 | break
194 | fi
195 | ;;
196 | *)
197 | error
198 | ;;
199 | esac
200 |
201 | done
202 |
203 | }
204 | socks_user_config() {
205 | echo
206 | while :; do
207 | read -p "$(echo -e "请输入$yellow用户名$none...(默认用户名: ${cyan}233blog$none)"): " new_socks_username
208 | [ -z "$new_socks_username" ] && new_socks_username="233blog"
209 | case $new_socks_username in
210 | *[/$]* | *\&*)
211 | echo
212 | echo -e " 由于这个脚本太辣鸡了..所以用户名不能包含$red / $none或$red $ $none或$red & $none这三个符号.... "
213 | echo
214 | error
215 | ;;
216 | *)
217 | echo
218 | echo
219 | echo -e "$yellow 用户名 = $cyan$new_socks_username$none"
220 | echo "----------------------------------------------------------------"
221 | echo
222 | break
223 | ;;
224 | esac
225 | done
226 |
227 | }
228 | socks_pass_config() {
229 | echo
230 | while :; do
231 | read -p "$(echo -e "请输入$yellow密码$none...(默认密码: ${cyan}233blog.com$none)"): " new_socks_userpass
232 | [ -z "$new_socks_userpass" ] && new_socks_userpass="233blog.com"
233 | case $new_socks_userpass in
234 | *[/$]* | *\&*)
235 | echo
236 | echo -e " 由于这个脚本太辣鸡了..所以密码不能包含$red / $none或$red $ $none或$red & $none这三个符号.... "
237 | echo
238 | error
239 | ;;
240 | *)
241 | echo
242 | echo
243 | echo -e "$yellow 密码 = $cyan$new_socks_userpass$none"
244 | echo "----------------------------------------------------------------"
245 | echo
246 | break
247 | ;;
248 | esac
249 | done
250 | }
251 | change_socks_user_config() {
252 | echo
253 | while :; do
254 | read -p "$(echo -e "请输入$yellow用户名$none...(当前用户名: ${cyan}$socks_username$none)"): " new_socks_username
255 | [ -z "$new_socks_username" ] && error && continue
256 | case $new_socks_username in
257 | $socks_username)
258 | echo
259 | echo -e " 大佬...跟 当前用户名 一毛一样啊...修改个鸡鸡哦 "
260 | echo
261 | error
262 | ;;
263 | *[/$]* | *\&*)
264 | echo
265 | echo -e " 由于这个脚本太辣鸡了..所以用户名不能包含$red / $none或$red $ $none或$red & $none这三个符号.... "
266 | echo
267 | error
268 | ;;
269 | *)
270 | echo
271 | echo
272 | echo -e "$yellow 用户名 = $cyan$new_socks_username$none"
273 | echo "----------------------------------------------------------------"
274 | echo
275 | pause
276 | backup_config socks_username
277 | socks_username=$new_socks_username
278 | config
279 | clear
280 | _socks_info
281 | break
282 | ;;
283 | esac
284 | done
285 | }
286 | change_socks_pass_config() {
287 | echo
288 | while :; do
289 | read -p "$(echo -e "请输入$yellow密码$none...(当前密码: ${cyan}$socks_userpass$none)"): " new_socks_userpass
290 | [ -z "$new_socks_userpass" ] && error && continue
291 | case $new_socks_userpass in
292 | $socks_userpass)
293 | echo
294 | echo -e " 大佬...跟 当前密码 一毛一样啊...修改个鸡鸡哦 "
295 | echo
296 | error
297 | ;;
298 | *[/$]* | *\&*)
299 | echo
300 | echo -e " 由于这个脚本太辣鸡了..所以密码不能包含$red / $none或$red $ $none或$red & $none这三个符号.... "
301 | echo
302 | error
303 | ;;
304 | *)
305 | echo
306 | echo
307 | echo -e "$yellow 密码 = $cyan$new_socks_userpass$none"
308 | echo "----------------------------------------------------------------"
309 | echo
310 | pause
311 | backup_config socks_userpass
312 | socks_userpass=$new_socks_userpass
313 | config
314 | clear
315 | _socks_info
316 | break
317 | ;;
318 | esac
319 | done
320 | }
321 | change_socks_port_config() {
322 | echo
323 | while :; do
324 | echo -e "请输入新的 "$yellow"Socks"$none" 端口 ["$magenta"1-65535"$none"]"
325 | read -p "$(echo -e "(当前端口: ${cyan}${socks_port}$none):") " new_socks_port
326 | [ -z "$new_socks_port" ] && error && continue
327 | case $new_socks_port in
328 | $socks_port)
329 | echo
330 | echo " 不能和当前端口一毛一样...."
331 | error
332 | ;;
333 | $v2ray_port)
334 | echo
335 | echo " 不能和 V2Ray 端口一毛一样...."
336 | error
337 | ;;
338 | [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])
339 | if [[ $v2ray_transport == [45] ]]; then
340 | local tls=ture
341 | fi
342 | if [[ $tls && $new_socks_port == "80" ]] || [[ $tls && $new_socks_port == "443" ]]; then
343 | echo
344 | echo -e "由于你已选择了 "$green"WebSocket + TLS $none或$green HTTP/2"$none" 传输协议."
345 | echo
346 | echo -e "所以不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
347 | error
348 | elif [[ $dynamicPort ]] && [[ $v2ray_dynamicPort_start == $new_socks_port || $v2ray_dynamicPort_end == $new_socks_port ]]; then
349 | echo
350 | echo -e " 抱歉,此端口和 V2Ray 动态端口 冲突,当前 V2Ray 动态端口范围为:${cyan}$port_range${none}"
351 | error
352 | elif [[ $dynamicPort ]] && [[ $v2ray_dynamicPort_start -lt $new_socks_port && $new_socks_port -le $v2ray_dynamicPort_end ]]; then
353 | echo
354 | echo -e " 抱歉,此端口和 V2Ray 动态端口 冲突,当前 V2Ray 动态端口范围为:${cyan}$port_range${none}"
355 | error
356 | elif [[ $shadowsocks && $new_socks_port == $ssport ]]; then
357 | echo
358 | echo -e "抱歉, 此端口跟 Shadowsocks 端口冲突...当前 Shadowsocks 端口: ${cyan}$ssport$none"
359 | error
360 | elif [[ $mtproto && $new_socks_port == $mtproto_port ]]; then
361 | echo
362 | echo -e "抱歉, 此端口跟 MTProto 端口冲突...当前 MTProto 端口: ${cyan}$mtproto_port$none"
363 | error
364 | else
365 | echo
366 | echo
367 | echo -e "$yellow socks 端口 = $cyan$new_socks_port$none"
368 | echo "----------------------------------------------------------------"
369 | echo
370 | pause
371 | backup_config socks_port
372 | socks_port=$new_socks_port
373 | config
374 | clear
375 | _socks_info
376 | break
377 | fi
378 | ;;
379 | *)
380 | error
381 | ;;
382 | esac
383 |
384 | done
385 |
386 | }
387 |
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | red='\e[91m'
4 | green='\e[92m'
5 | yellow='\e[93m'
6 | magenta='\e[95m'
7 | cyan='\e[96m'
8 | none='\e[0m'
9 |
10 | # Root
11 | [[ $(id -u) != 0 ]] && echo -e "\n 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}\n" && exit 1
12 |
13 | cmd="apt-get"
14 |
15 | sys_bit=$(uname -m)
16 |
17 | if [[ $sys_bit == "i386" || $sys_bit == "i686" ]]; then
18 | v2ray_bit="32"
19 | elif [[ $sys_bit == "x86_64" ]]; then
20 | v2ray_bit="64"
21 | else
22 | echo -e "
23 | 哈哈……这个 ${red}辣鸡脚本${none} 不支持你的系统。 ${yellow}(-_-) ${none}
24 |
25 | 备注: 仅支持 Ubuntu 16+ / Debian 8+ / CentOS 7+ 系统
26 | " && exit 1
27 | fi
28 |
29 | # 笨笨的检测方法
30 | if [[ -f /usr/bin/apt-get || -f /usr/bin/yum ]] && [[ -f /bin/systemctl ]]; then
31 |
32 | if [[ -f /usr/bin/yum ]]; then
33 |
34 | cmd="yum"
35 |
36 | fi
37 |
38 | else
39 |
40 | echo -e "
41 | 哈哈……这个 ${red}辣鸡脚本${none} 不支持你的系统。 ${yellow}(-_-) ${none}
42 |
43 | 备注: 仅支持 Ubuntu 16+ / Debian 8+ / CentOS 7+ 系统
44 | " && exit 1
45 |
46 | fi
47 |
48 | uuid=$(cat /proc/sys/kernel/random/uuid)
49 | old_id="e55c8d17-2cf3-b21a-bcf1-eeacb011ed79"
50 | v2ray_server_config="/etc/v2ray/config.json"
51 | v2ray_client_config="/etc/v2ray/233blog_v2ray_config.json"
52 | backup="/etc/v2ray/233blog_v2ray_backup.conf"
53 | _v2ray_sh="/usr/local/sbin/v2ray"
54 | systemd=true
55 | # _test=true
56 |
57 | transport=(
58 | TCP
59 | TCP_HTTP
60 | WebSocket
61 | "WebSocket + TLS"
62 | HTTP/2
63 | mKCP
64 | mKCP_utp
65 | mKCP_srtp
66 | mKCP_wechat-video
67 | mKCP_dtls
68 | mKCP_wireguard
69 | QUIC
70 | QUIC_utp
71 | QUIC_srtp
72 | QUIC_wechat-video
73 | QUIC_dtls
74 | QUIC_wireguard
75 | TCP_dynamicPort
76 | TCP_HTTP_dynamicPort
77 | WebSocket_dynamicPort
78 | mKCP_dynamicPort
79 | mKCP_utp_dynamicPort
80 | mKCP_srtp_dynamicPort
81 | mKCP_wechat-video_dynamicPort
82 | mKCP_dtls_dynamicPort
83 | mKCP_wireguard_dynamicPort
84 | QUIC_dynamicPort
85 | QUIC_utp_dynamicPort
86 | QUIC_srtp_dynamicPort
87 | QUIC_wechat-video_dynamicPort
88 | QUIC_dtls_dynamicPort
89 | QUIC_wireguard_dynamicPort
90 | )
91 |
92 | ciphers=(
93 | aes-128-cfb
94 | aes-256-cfb
95 | chacha20
96 | chacha20-ietf
97 | aes-128-gcm
98 | aes-256-gcm
99 | chacha20-ietf-poly1305
100 | )
101 |
102 | _load() {
103 | local _dir="/etc/v2ray/233boy/v2ray/src/"
104 | . "${_dir}$@"
105 | }
106 |
107 | v2ray_config() {
108 | # clear
109 | echo
110 | while :; do
111 | echo -e "请选择 "$yellow"V2Ray"$none" 传输协议 [${magenta}1-${#transport[*]}$none]"
112 | echo
113 | for ((i = 1; i <= ${#transport[*]}; i++)); do
114 | Stream="${transport[$i - 1]}"
115 | if [[ "$i" -le 9 ]]; then
116 | # echo
117 | echo -e "$yellow $i. $none${Stream}"
118 | else
119 | # echo
120 | echo -e "$yellow $i. $none${Stream}"
121 | fi
122 | done
123 | echo
124 | echo "备注1: 含有 [dynamicPort] 的即启用动态端口.."
125 | echo "备注2: [utp | srtp | wechat-video | dtls | wireguard] 分别伪装成 [BT下载 | 视频通话 | 微信视频通话 | DTLS 1.2 数据包 | WireGuard 数据包]"
126 | echo
127 | read -p "$(echo -e "(默认协议: ${cyan}TCP$none)"):" v2ray_transport
128 | [ -z "$v2ray_transport" ] && v2ray_transport=1
129 | case $v2ray_transport in
130 | [1-9] | [1-2][0-9] | 3[0-2])
131 | echo
132 | echo
133 | echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport - 1]}$none"
134 | echo "----------------------------------------------------------------"
135 | echo
136 | break
137 | ;;
138 | *)
139 | error
140 | ;;
141 | esac
142 | done
143 | v2ray_port_config
144 | }
145 | v2ray_port_config() {
146 | case $v2ray_transport in
147 | 4 | 5)
148 | tls_config
149 | ;;
150 | *)
151 | local random=$(shuf -i20001-65535 -n1)
152 | while :; do
153 | echo -e "请输入 "$yellow"V2Ray"$none" 端口 ["$magenta"1-65535"$none"]"
154 | read -p "$(echo -e "(默认端口: ${cyan}${random}$none):")" v2ray_port
155 | [ -z "$v2ray_port" ] && v2ray_port=$random
156 | case $v2ray_port in
157 | [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])
158 | echo
159 | echo
160 | echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none"
161 | echo "----------------------------------------------------------------"
162 | echo
163 | break
164 | ;;
165 | *)
166 | error
167 | ;;
168 | esac
169 | done
170 | if [[ $v2ray_transport -ge 18 ]]; then
171 | v2ray_dynamic_port_start
172 | fi
173 | ;;
174 | esac
175 | }
176 |
177 | v2ray_dynamic_port_start() {
178 |
179 | while :; do
180 | echo -e "请输入 "$yellow"V2Ray 动态端口开始 "$none"范围 ["$magenta"1-65535"$none"]"
181 | read -p "$(echo -e "(默认开始端口: ${cyan}10000$none):")" v2ray_dynamic_port_start_input
182 | [ -z $v2ray_dynamic_port_start_input ] && v2ray_dynamic_port_start_input=10000
183 | case $v2ray_dynamic_port_start_input in
184 | $v2ray_port)
185 | echo
186 | echo " 不能和 V2Ray 端口一毛一样...."
187 | echo
188 | echo -e " 当前 V2Ray 端口:${cyan}$v2ray_port${none}"
189 | error
190 | ;;
191 | [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])
192 | echo
193 | echo
194 | echo -e "$yellow V2Ray 动态端口开始 = $cyan$v2ray_dynamic_port_start_input$none"
195 | echo "----------------------------------------------------------------"
196 | echo
197 | break
198 | ;;
199 | *)
200 | error
201 | ;;
202 | esac
203 |
204 | done
205 |
206 | if [[ $v2ray_dynamic_port_start_input -lt $v2ray_port ]]; then
207 | lt_v2ray_port=true
208 | fi
209 |
210 | v2ray_dynamic_port_end
211 | }
212 | v2ray_dynamic_port_end() {
213 |
214 | while :; do
215 | echo -e "请输入 "$yellow"V2Ray 动态端口结束 "$none"范围 ["$magenta"1-65535"$none"]"
216 | read -p "$(echo -e "(默认结束端口: ${cyan}20000$none):")" v2ray_dynamic_port_end_input
217 | [ -z $v2ray_dynamic_port_end_input ] && v2ray_dynamic_port_end_input=20000
218 | case $v2ray_dynamic_port_end_input in
219 | [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])
220 |
221 | if [[ $v2ray_dynamic_port_end_input -le $v2ray_dynamic_port_start_input ]]; then
222 | echo
223 | echo " 不能小于或等于 V2Ray 动态端口开始范围"
224 | echo
225 | echo -e " 当前 V2Ray 动态端口开始:${cyan}$v2ray_dynamic_port_start_input${none}"
226 | error
227 | elif [ $lt_v2ray_port ] && [[ ${v2ray_dynamic_port_end_input} -ge $v2ray_port ]]; then
228 | echo
229 | echo " V2Ray 动态端口结束范围 不能包括 V2Ray 端口..."
230 | echo
231 | echo -e " 当前 V2Ray 端口:${cyan}$v2ray_port${none}"
232 | error
233 | else
234 | echo
235 | echo
236 | echo -e "$yellow V2Ray 动态端口结束 = $cyan$v2ray_dynamic_port_end_input$none"
237 | echo "----------------------------------------------------------------"
238 | echo
239 | break
240 | fi
241 | ;;
242 | *)
243 | error
244 | ;;
245 | esac
246 |
247 | done
248 |
249 | }
250 |
251 | tls_config() {
252 |
253 | echo
254 | local random=$(shuf -i20001-65535 -n1)
255 | while :; do
256 | echo -e "请输入 "$yellow"V2Ray"$none" 端口 ["$magenta"1-65535"$none"],不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
257 | read -p "$(echo -e "(默认端口: ${cyan}${random}$none):")" v2ray_port
258 | [ -z "$v2ray_port" ] && v2ray_port=$random
259 | case $v2ray_port in
260 | 80)
261 | echo
262 | echo " ...都说了不能选择 80 端口了咯....."
263 | error
264 | ;;
265 | 443)
266 | echo
267 | echo " ..都说了不能选择 443 端口了咯....."
268 | error
269 | ;;
270 | [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])
271 | echo
272 | echo
273 | echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none"
274 | echo "----------------------------------------------------------------"
275 | echo
276 | break
277 | ;;
278 | *)
279 | error
280 | ;;
281 | esac
282 | done
283 |
284 | while :; do
285 | echo
286 | echo -e "请输入一个 $magenta正确的域名$none,一定一定一定要正确,不!能!出!错!"
287 | read -p "(例如:233blog.com): " domain
288 | [ -z "$domain" ] && error && continue
289 | echo
290 | echo
291 | echo -e "$yellow 你的域名 = $cyan$domain$none"
292 | echo "----------------------------------------------------------------"
293 | break
294 | done
295 | get_ip
296 | echo
297 | echo
298 | echo -e "$yellow 请将 $magenta$domain$none $yellow解析到: $cyan$ip$none"
299 | echo
300 | echo -e "$yellow 请将 $magenta$domain$none $yellow解析到: $cyan$ip$none"
301 | echo
302 | echo -e "$yellow 请将 $magenta$domain$none $yellow解析到: $cyan$ip$none"
303 | echo "----------------------------------------------------------------"
304 | echo
305 |
306 | while :; do
307 |
308 | read -p "$(echo -e "(是否已经正确解析: [${magenta}Y$none]):") " record
309 | if [[ -z "$record" ]]; then
310 | error
311 | else
312 | if [[ "$record" == [Yy] ]]; then
313 | domain_check
314 | echo
315 | echo
316 | echo -e "$yellow 域名解析 = ${cyan}我确定已经有解析了$none"
317 | echo "----------------------------------------------------------------"
318 | echo
319 | break
320 | else
321 | error
322 | fi
323 | fi
324 |
325 | done
326 |
327 | if [[ $v2ray_transport -ne 5 ]]; then
328 | auto_tls_config
329 | else
330 | caddy=true
331 | install_caddy_info="打开"
332 | fi
333 |
334 | if [[ $caddy ]]; then
335 | path_config_ask
336 | fi
337 | }
338 | auto_tls_config() {
339 | echo -e "
340 |
341 | 安装 Caddy 来实现 自动配置 TLS
342 |
343 | 如果你已经安装 Nginx 或 Caddy
344 |
345 | $yellow并且..自己能搞定配置 TLS$none
346 |
347 | 那么就不需要 打开自动配置 TLS
348 | "
349 | echo "----------------------------------------------------------------"
350 | echo
351 |
352 | while :; do
353 |
354 | read -p "$(echo -e "(是否自动配置 TLS: [${magenta}Y/N$none]):") " auto_install_caddy
355 | if [[ -z "$auto_install_caddy" ]]; then
356 | error
357 | else
358 | if [[ "$auto_install_caddy" == [Yy] ]]; then
359 | caddy=true
360 | install_caddy_info="打开"
361 | echo
362 | echo
363 | echo -e "$yellow 自动配置 TLS = $cyan$install_caddy_info$none"
364 | echo "----------------------------------------------------------------"
365 | echo
366 | break
367 | elif [[ "$auto_install_caddy" == [Nn] ]]; then
368 | install_caddy_info="关闭"
369 | echo
370 | echo
371 | echo -e "$yellow 自动配置 TLS = $cyan$install_caddy_info$none"
372 | echo "----------------------------------------------------------------"
373 | echo
374 | break
375 | else
376 | error
377 | fi
378 | fi
379 |
380 | done
381 | }
382 | path_config_ask() {
383 | echo
384 | while :; do
385 | echo -e "是否开启 网站伪装 和 路径分流 [${magenta}Y/N$none]"
386 | read -p "$(echo -e "(默认: [${cyan}N$none]):")" path_ask
387 | [[ -z $path_ask ]] && path_ask="n"
388 |
389 | case $path_ask in
390 | Y | y)
391 | path_config
392 | break
393 | ;;
394 | N | n)
395 | echo
396 | echo
397 | echo -e "$yellow 网站伪装 和 路径分流 = $cyan不想配置$none"
398 | echo "----------------------------------------------------------------"
399 | echo
400 | break
401 | ;;
402 | *)
403 | error
404 | ;;
405 | esac
406 | done
407 | }
408 | path_config() {
409 | echo
410 | while :; do
411 | echo -e "请输入想要 ${magenta}用来分流的路径$none , 例如 /233blog , 那么只需要输入 233blog 即可"
412 | read -p "$(echo -e "(默认: [${cyan}233blog$none]):")" path
413 | [[ -z $path ]] && path="233blog"
414 |
415 | case $path in
416 | *[/$]*)
417 | echo
418 | echo -e " 由于这个脚本太辣鸡了..所以分流的路径不能包含$red / $none或$red $ $none这两个符号.... "
419 | echo
420 | error
421 | ;;
422 | *)
423 | echo
424 | echo
425 | echo -e "$yellow 分流的路径 = ${cyan}/${path}$none"
426 | echo "----------------------------------------------------------------"
427 | echo
428 | break
429 | ;;
430 | esac
431 | done
432 | is_path=true
433 | proxy_site_config
434 | }
435 | proxy_site_config() {
436 | echo
437 | while :; do
438 | echo -e "请输入 ${magenta}一个正确的$none ${cyan}网址$none 用来作为 ${cyan}网站的伪装$none , 例如 https://liyafly.com"
439 | echo -e "举例...你当前的域名是 $green$domain$none , 伪装的网址的是 https://liyafly.com"
440 | echo -e "然后打开你的域名时候...显示出来的内容就是来自 https://liyafly.com 的内容"
441 | echo -e "其实就是一个反代...明白就好..."
442 | echo -e "如果不能伪装成功...可以使用 v2ray config 修改伪装的网址"
443 | read -p "$(echo -e "(默认: [${cyan}https://liyafly.com$none]):")" proxy_site
444 | [[ -z $proxy_site ]] && proxy_site="https://liyafly.com"
445 |
446 | case $proxy_site in
447 | *[#$]*)
448 | echo
449 | echo -e " 由于这个脚本太辣鸡了..所以伪装的网址不能包含$red # $none或$red $ $none这两个符号.... "
450 | echo
451 | error
452 | ;;
453 | *)
454 | echo
455 | echo
456 | echo -e "$yellow 伪装的网址 = ${cyan}${proxy_site}$none"
457 | echo "----------------------------------------------------------------"
458 | echo
459 | break
460 | ;;
461 | esac
462 | done
463 | }
464 |
465 | blocked_hosts() {
466 | echo
467 | while :; do
468 | echo -e "是否开启广告拦截(会影响性能) [${magenta}Y/N$none]"
469 | read -p "$(echo -e "(默认 [${cyan}N$none]):")" blocked_ad
470 | [[ -z $blocked_ad ]] && blocked_ad="n"
471 |
472 | case $blocked_ad in
473 | Y | y)
474 | blocked_ad_info="开启"
475 | ban_ad=true
476 | echo
477 | echo
478 | echo -e "$yellow 广告拦截 = $cyan开启$none"
479 | echo "----------------------------------------------------------------"
480 | echo
481 | break
482 | ;;
483 | N | n)
484 | blocked_ad_info="关闭"
485 | echo
486 | echo
487 | echo -e "$yellow 广告拦截 = $cyan关闭$none"
488 | echo "----------------------------------------------------------------"
489 | echo
490 | break
491 | ;;
492 | *)
493 | error
494 | ;;
495 | esac
496 | done
497 | }
498 | shadowsocks_config() {
499 |
500 | echo
501 |
502 | while :; do
503 | echo -e "是否配置 ${yellow}Shadowsocks${none} [${magenta}Y/N$none]"
504 | read -p "$(echo -e "(默认 [${cyan}N$none]):") " install_shadowsocks
505 | [[ -z "$install_shadowsocks" ]] && install_shadowsocks="n"
506 | if [[ "$install_shadowsocks" == [Yy] ]]; then
507 | echo
508 | shadowsocks=true
509 | shadowsocks_port_config
510 | break
511 | elif [[ "$install_shadowsocks" == [Nn] ]]; then
512 | break
513 | else
514 | error
515 | fi
516 |
517 | done
518 |
519 | }
520 |
521 | shadowsocks_port_config() {
522 | local random=$(shuf -i20001-65535 -n1)
523 | while :; do
524 | echo -e "请输入 "$yellow"Shadowsocks"$none" 端口 ["$magenta"1-65535"$none"],不能和 "$yellow"V2Ray"$none" 端口相同"
525 | read -p "$(echo -e "(默认端口: ${cyan}${random}$none):") " ssport
526 | [ -z "$ssport" ] && ssport=$random
527 | case $ssport in
528 | $v2ray_port)
529 | echo
530 | echo " 不能和 V2Ray 端口一毛一样...."
531 | error
532 | ;;
533 | [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])
534 | if [[ $v2ray_transport == [45] ]]; then
535 | local tls=ture
536 | fi
537 | if [[ $tls && $ssport == "80" ]] || [[ $tls && $ssport == "443" ]]; then
538 | echo
539 | echo -e "由于你已选择了 "$green"WebSocket + TLS $none或$green HTTP/2"$none" 传输协议."
540 | echo
541 | echo -e "所以不能选择 "$magenta"80"$none" 或 "$magenta"443"$none" 端口"
542 | error
543 | elif [[ $v2ray_dynamic_port_start_input == $ssport || $v2ray_dynamic_port_end_input == $ssport ]]; then
544 | local multi_port="${v2ray_dynamic_port_start_input} - ${v2ray_dynamic_port_end_input}"
545 | echo
546 | echo " 抱歉,此端口和 V2Ray 动态端口 冲突,当前 V2Ray 动态端口范围为:$multi_port"
547 | error
548 | elif [[ $v2ray_dynamic_port_start_input -lt $ssport && $ssport -le $v2ray_dynamic_port_end_input ]]; then
549 | local multi_port="${v2ray_dynamic_port_start_input} - ${v2ray_dynamic_port_end_input}"
550 | echo
551 | echo " 抱歉,此端口和 V2Ray 动态端口 冲突,当前 V2Ray 动态端口范围为:$multi_port"
552 | error
553 | else
554 | echo
555 | echo
556 | echo -e "$yellow Shadowsocks 端口 = $cyan$ssport$none"
557 | echo "----------------------------------------------------------------"
558 | echo
559 | break
560 | fi
561 | ;;
562 | *)
563 | error
564 | ;;
565 | esac
566 |
567 | done
568 |
569 | shadowsocks_password_config
570 | }
571 | shadowsocks_password_config() {
572 |
573 | while :; do
574 | echo -e "请输入 "$yellow"Shadowsocks"$none" 密码"
575 | read -p "$(echo -e "(默认密码: ${cyan}233blog.com$none)"): " sspass
576 | [ -z "$sspass" ] && sspass="233blog.com"
577 | case $sspass in
578 | *[/$]*)
579 | echo
580 | echo -e " 由于这个脚本太辣鸡了..所以密码不能包含$red / $none或$red $ $none这两个符号.... "
581 | echo
582 | error
583 | ;;
584 | *)
585 | echo
586 | echo
587 | echo -e "$yellow Shadowsocks 密码 = $cyan$sspass$none"
588 | echo "----------------------------------------------------------------"
589 | echo
590 | break
591 | ;;
592 | esac
593 |
594 | done
595 |
596 | shadowsocks_ciphers_config
597 | }
598 | shadowsocks_ciphers_config() {
599 |
600 | while :; do
601 | echo -e "请选择 "$yellow"Shadowsocks"$none" 加密协议 [${magenta}1-${#ciphers[*]}$none]"
602 | for ((i = 1; i <= ${#ciphers[*]}; i++)); do
603 | ciphers_show="${ciphers[$i - 1]}"
604 | echo
605 | echo -e "$yellow $i. $none${ciphers_show}"
606 | done
607 | echo
608 | read -p "$(echo -e "(默认加密协议: ${cyan}${ciphers[6]}$none)"):" ssciphers_opt
609 | [ -z "$ssciphers_opt" ] && ssciphers_opt=7
610 | case $ssciphers_opt in
611 | [1-7])
612 | ssciphers=${ciphers[$ssciphers_opt - 1]}
613 | echo
614 | echo
615 | echo -e "$yellow Shadowsocks 加密协议 = $cyan${ssciphers}$none"
616 | echo "----------------------------------------------------------------"
617 | echo
618 | break
619 | ;;
620 | *)
621 | error
622 | ;;
623 | esac
624 |
625 | done
626 | pause
627 | }
628 |
629 | install_info() {
630 | clear
631 | echo
632 | echo " ....准备安装了咯..看看有毛有配置正确了..."
633 | echo
634 | echo "---------- 安装信息 -------------"
635 | echo
636 | echo -e "$yellow V2Ray 传输协议 = $cyan${transport[$v2ray_transport - 1]}$none"
637 |
638 | if [[ $v2ray_transport == [45] ]]; then
639 | echo
640 | echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none"
641 | echo
642 | echo -e "$yellow 你的域名 = $cyan$domain$none"
643 | echo
644 | echo -e "$yellow 域名解析 = ${cyan}我确定已经有解析了$none"
645 | echo
646 | echo -e "$yellow 自动配置 TLS = $cyan$install_caddy_info$none"
647 |
648 | if [[ $ban_ad ]]; then
649 | echo
650 | echo -e "$yellow 广告拦截 = $cyan$blocked_ad_info$none"
651 | fi
652 | if [[ $is_path ]]; then
653 | echo
654 | echo -e "$yellow 路径分流 = ${cyan}/${path}$none"
655 | fi
656 | elif [[ $v2ray_transport -ge 18 ]]; then
657 | echo
658 | echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none"
659 | echo
660 | echo -e "$yellow V2Ray 动态端口范围 = $cyan${v2ray_dynamic_port_start_input} - ${v2ray_dynamic_port_end_input}$none"
661 |
662 | if [[ $ban_ad ]]; then
663 | echo
664 | echo -e "$yellow 广告拦截 = $cyan$blocked_ad_info$none"
665 | fi
666 | else
667 | echo
668 | echo -e "$yellow V2Ray 端口 = $cyan$v2ray_port$none"
669 |
670 | if [[ $ban_ad ]]; then
671 | echo
672 | echo -e "$yellow 广告拦截 = $cyan$blocked_ad_info$none"
673 | fi
674 | fi
675 | if [ $shadowsocks ]; then
676 | echo
677 | echo -e "$yellow Shadowsocks 端口 = $cyan$ssport$none"
678 | echo
679 | echo -e "$yellow Shadowsocks 密码 = $cyan$sspass$none"
680 | echo
681 | echo -e "$yellow Shadowsocks 加密协议 = $cyan${ssciphers}$none"
682 | else
683 | echo
684 | echo -e "$yellow 是否配置 Shadowsocks = ${cyan}未配置${none}"
685 | fi
686 | echo
687 | echo "---------- END -------------"
688 | echo
689 | pause
690 | echo
691 | }
692 |
693 | domain_check() {
694 | # if [[ $cmd == "yum" ]]; then
695 | # yum install bind-utils -y
696 | # else
697 | # $cmd install dnsutils -y
698 | # fi
699 | # test_domain=$(dig $domain +short)
700 | test_domain=$(ping $domain -c 1 | grep -oE -m1 "([0-9]{1,3}\.){3}[0-9]{1,3}")
701 | if [[ $test_domain != $ip ]]; then
702 | echo
703 | echo -e "$red 检测域名解析错误....$none"
704 | echo
705 | echo -e " 你的域名: $yellow$domain$none 未解析到: $cyan$ip$none"
706 | echo
707 | echo -e " 你的域名当前解析到: $cyan$test_domain$none"
708 | echo
709 | echo "备注...如果你的域名是使用 Cloudflare 解析的话..在 Status 那里点一下那图标..让它变灰"
710 | echo
711 | exit 1
712 | fi
713 | }
714 |
715 | install_caddy() {
716 | # download caddy file then install
717 | _load download-caddy.sh
718 | _download_caddy_file
719 | _install_caddy_service
720 | caddy_config
721 |
722 | }
723 | caddy_config() {
724 | # local email=$(shuf -i1-10000000000 -n1)
725 | _load caddy-config.sh
726 |
727 | # systemctl restart caddy
728 | do_service restart caddy
729 | }
730 |
731 | install_v2ray() {
732 | $cmd update -y
733 | if [[ $cmd == "apt-get" ]]; then
734 | $cmd install -y lrzsz git zip unzip curl wget qrencode libcap2-bin
735 | else
736 | # $cmd install -y lrzsz git zip unzip curl wget qrencode libcap iptables-services
737 | $cmd install -y lrzsz git zip unzip curl wget qrencode libcap
738 | fi
739 | ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
740 | [ -d /etc/v2ray ] && rm -rf /etc/v2ray
741 | date -s "$(curl -sI g.cn | grep Date | cut -d' ' -f3-6)Z"
742 |
743 | if [[ $local_install ]]; then
744 | if [[ ! -d $(pwd)/config ]]; then
745 | echo
746 | echo -e "$red 哎呀呀...安装失败了咯...$none"
747 | echo
748 | echo -e " 请确保你有完整的上传 v2ray6.com 的 V2Ray 一键安装脚本 & 管理脚本到当前 ${green}$(pwd) $none目录下"
749 | echo
750 | exit 1
751 | fi
752 | mkdir -p /etc/v2ray/233boy/v2ray
753 | cp -rf $(pwd)/* /etc/v2ray/233boy/v2ray
754 | else
755 | pushd /tmp
756 | if [[ $_test ]]; then
757 | git clone https://github.com/233boy/v2ray -b test /etc/v2ray/233boy/v2ray
758 | else
759 | git clone https://github.com/233boy/v2ray /etc/v2ray/233boy/v2ray
760 | fi
761 | popd
762 |
763 | fi
764 |
765 | if [[ ! -d /etc/v2ray/233boy/v2ray ]]; then
766 | echo
767 | echo -e "$red 哎呀呀...克隆脚本仓库出错了...$none"
768 | echo
769 | echo -e " 温馨提示..... 请尝试自行安装 Git: ${green}$cmd install -y git $none 之后再安装此脚本"
770 | echo
771 | exit 1
772 | fi
773 |
774 | # download v2ray file then install
775 | _load download-v2ray.sh
776 | _download_v2ray_file
777 | _install_v2ray_service
778 | _mkdir_dir
779 | }
780 |
781 | open_port() {
782 | if [[ $cmd == "apt-get" ]]; then
783 | if [[ $1 != "multiport" ]]; then
784 |
785 | iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport $1 -j ACCEPT
786 | iptables -I INPUT -m state --state NEW -m udp -p udp --dport $1 -j ACCEPT
787 | ip6tables -I INPUT -m state --state NEW -m tcp -p tcp --dport $1 -j ACCEPT
788 | ip6tables -I INPUT -m state --state NEW -m udp -p udp --dport $1 -j ACCEPT
789 |
790 | # firewall-cmd --permanent --zone=public --add-port=$1/tcp
791 | # firewall-cmd --permanent --zone=public --add-port=$1/udp
792 | # firewall-cmd --reload
793 |
794 | else
795 |
796 | local multiport="${v2ray_dynamic_port_start_input}:${v2ray_dynamic_port_end_input}"
797 | iptables -I INPUT -p tcp --match multiport --dports $multiport -j ACCEPT
798 | iptables -I INPUT -p udp --match multiport --dports $multiport -j ACCEPT
799 | ip6tables -I INPUT -p tcp --match multiport --dports $multiport -j ACCEPT
800 | ip6tables -I INPUT -p udp --match multiport --dports $multiport -j ACCEPT
801 |
802 | # local multi_port="${v2ray_dynamic_port_start_input}-${v2ray_dynamic_port_end_input}"
803 | # firewall-cmd --permanent --zone=public --add-port=$multi_port/tcp
804 | # firewall-cmd --permanent --zone=public --add-port=$multi_port/udp
805 | # firewall-cmd --reload
806 |
807 | fi
808 | iptables-save >/etc/iptables.rules.v4
809 | ip6tables-save >/etc/iptables.rules.v6
810 | # else
811 | # service iptables save >/dev/null 2>&1
812 | # service ip6tables save >/dev/null 2>&1
813 | fi
814 | }
815 | del_port() {
816 | if [[ $cmd == "apt-get" ]]; then
817 | if [[ $1 != "multiport" ]]; then
818 | # if [[ $cmd == "apt-get" ]]; then
819 | iptables -D INPUT -m state --state NEW -m tcp -p tcp --dport $1 -j ACCEPT
820 | iptables -D INPUT -m state --state NEW -m udp -p udp --dport $1 -j ACCEPT
821 | ip6tables -D INPUT -m state --state NEW -m tcp -p tcp --dport $1 -j ACCEPT
822 | ip6tables -D INPUT -m state --state NEW -m udp -p udp --dport $1 -j ACCEPT
823 | # else
824 | # firewall-cmd --permanent --zone=public --remove-port=$1/tcp
825 | # firewall-cmd --permanent --zone=public --remove-port=$1/udp
826 | # fi
827 | else
828 | # if [[ $cmd == "apt-get" ]]; then
829 | local ports="${v2ray_dynamicPort_start}:${v2ray_dynamicPort_end}"
830 | iptables -D INPUT -p tcp --match multiport --dports $ports -j ACCEPT
831 | iptables -D INPUT -p udp --match multiport --dports $ports -j ACCEPT
832 | ip6tables -D INPUT -p tcp --match multiport --dports $ports -j ACCEPT
833 | ip6tables -D INPUT -p udp --match multiport --dports $ports -j ACCEPT
834 | # else
835 | # local ports="${v2ray_dynamicPort_start}-${v2ray_dynamicPort_end}"
836 | # firewall-cmd --permanent --zone=public --remove-port=$ports/tcp
837 | # firewall-cmd --permanent --zone=public --remove-port=$ports/udp
838 | # fi
839 | fi
840 | iptables-save >/etc/iptables.rules.v4
841 | ip6tables-save >/etc/iptables.rules.v6
842 | # else
843 | # service iptables save >/dev/null 2>&1
844 | # service ip6tables save >/dev/null 2>&1
845 | fi
846 |
847 | }
848 |
849 | config() {
850 | cp -f /etc/v2ray/233boy/v2ray/config/backup.conf $backup
851 | cp -f /etc/v2ray/233boy/v2ray/v2ray.sh $_v2ray_sh
852 | chmod +x $_v2ray_sh
853 |
854 | v2ray_id=$uuid
855 | alterId=233
856 | ban_bt=true
857 | if [[ $v2ray_transport -ge 18 ]]; then
858 | v2ray_dynamicPort_start=${v2ray_dynamic_port_start_input}
859 | v2ray_dynamicPort_end=${v2ray_dynamic_port_end_input}
860 | fi
861 | _load config.sh
862 |
863 | if [[ $cmd == "apt-get" ]]; then
864 | cat >/etc/network/if-pre-up.d/iptables <<-EOF
865 | #!/bin/sh
866 | /sbin/iptables-restore < /etc/iptables.rules.v4
867 | /sbin/ip6tables-restore < /etc/iptables.rules.v6
868 | EOF
869 | chmod +x /etc/network/if-pre-up.d/iptables
870 | # else
871 | # [ $(pgrep "firewall") ] && systemctl stop firewalld
872 | # systemctl mask firewalld
873 | # systemctl disable firewalld
874 | # systemctl enable iptables
875 | # systemctl enable ip6tables
876 | # systemctl start iptables
877 | # systemctl start ip6tables
878 | fi
879 |
880 | [[ $shadowsocks ]] && open_port $ssport
881 | if [[ $v2ray_transport == [45] ]]; then
882 | open_port "80"
883 | open_port "443"
884 | open_port $v2ray_port
885 | elif [[ $v2ray_transport -ge 18 ]]; then
886 | open_port $v2ray_port
887 | open_port "multiport"
888 | else
889 | open_port $v2ray_port
890 | fi
891 | # systemctl restart v2ray
892 | do_service restart v2ray
893 | backup_config
894 |
895 | }
896 |
897 | backup_config() {
898 | sed -i "18s/=1/=$v2ray_transport/; 21s/=2333/=$v2ray_port/; 24s/=$old_id/=$uuid/" $backup
899 | if [[ $v2ray_transport -ge 18 ]]; then
900 | sed -i "30s/=10000/=$v2ray_dynamic_port_start_input/; 33s/=20000/=$v2ray_dynamic_port_end_input/" $backup
901 | fi
902 | if [[ $shadowsocks ]]; then
903 | sed -i "42s/=/=true/; 45s/=6666/=$ssport/; 48s/=233blog.com/=$sspass/; 51s/=chacha20-ietf/=$ssciphers/" $backup
904 | fi
905 | [[ $v2ray_transport == [45] ]] && sed -i "36s/=233blog.com/=$domain/" $backup
906 | [[ $caddy ]] && sed -i "39s/=/=true/" $backup
907 | [[ $ban_ad ]] && sed -i "54s/=/=true/" $backup
908 | if [[ $is_path ]]; then
909 | sed -i "57s/=/=true/; 60s/=233blog/=$path/" $backup
910 | sed -i "63s#=https://liyafly.com#=$proxy_site#" $backup
911 | fi
912 | }
913 |
914 | try_enable_bbr() {
915 | if [[ $(uname -r | cut -b 1) -eq 4 ]]; then
916 | case $(uname -r | cut -b 3-4) in
917 | 9. | [1-9][0-9])
918 | sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
919 | sed -i '/net.core.default_qdisc/d' /etc/sysctl.conf
920 | echo "net.ipv4.tcp_congestion_control = bbr" >>/etc/sysctl.conf
921 | echo "net.core.default_qdisc = fq" >>/etc/sysctl.conf
922 | sysctl -p >/dev/null 2>&1
923 | ;;
924 | esac
925 | fi
926 | }
927 |
928 | get_ip() {
929 | ip=$(curl -s https://ipinfo.io/ip)
930 | [[ -z $ip ]] && ip=$(curl -s https://api.ip.sb/ip)
931 | [[ -z $ip ]] && ip=$(curl -s https://api.ipify.org)
932 | [[ -z $ip ]] && ip=$(curl -s https://ip.seeip.org)
933 | [[ -z $ip ]] && ip=$(curl -s https://ifconfig.co/ip)
934 | [[ -z $ip ]] && ip=$(curl -s https://api.myip.com | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}")
935 | [[ -z $ip ]] && ip=$(curl -s icanhazip.com)
936 | [[ -z $ip ]] && ip=$(curl -s myip.ipip.net | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}")
937 | [[ -z $ip ]] && echo -e "\n$red 这垃圾小鸡扔了吧!$none\n" && exit
938 | }
939 |
940 | error() {
941 |
942 | echo -e "\n$red 输入错误!$none\n"
943 |
944 | }
945 |
946 | pause() {
947 |
948 | read -rsp "$(echo -e "按$green Enter 回车键 $none继续....或按$red Ctrl + C $none取消.")" -d $'\n'
949 | echo
950 | }
951 | do_service() {
952 | if [[ $systemd ]]; then
953 | systemctl $1 $2
954 | else
955 | service $2 $1
956 | fi
957 | }
958 | show_config_info() {
959 | clear
960 | _load v2ray-info.sh
961 | _v2_args
962 | _v2_info
963 | _load ss-info.sh
964 |
965 | }
966 |
967 | install() {
968 | if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup && -d /etc/v2ray/233boy/v2ray ]]; then
969 | echo
970 | echo " 大佬...你已经安装 V2Ray 啦...无需重新安装"
971 | echo
972 | echo -e " $yellow输入 ${cyan}v2ray${none} $yellow即可管理 V2Ray${none}"
973 | echo
974 | exit 1
975 | elif [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f /etc/v2ray/233blog_v2ray_backup.txt && -d /etc/v2ray/233boy/v2ray ]]; then
976 | echo
977 | echo " 如果你需要继续安装.. 请先卸载旧版本"
978 | echo
979 | echo -e " $yellow输入 ${cyan}v2ray uninstall${none} $yellow即可卸载${none}"
980 | echo
981 | exit 1
982 | fi
983 | v2ray_config
984 | blocked_hosts
985 | shadowsocks_config
986 | install_info
987 | try_enable_bbr
988 | # [[ $caddy ]] && domain_check
989 | install_v2ray
990 | if [[ $caddy || $v2ray_port == "80" ]]; then
991 | if [[ $cmd == "yum" ]]; then
992 | [[ $(pgrep "httpd") ]] && systemctl stop httpd
993 | [[ $(command -v httpd) ]] && yum remove httpd -y
994 | else
995 | [[ $(pgrep "apache2") ]] && service apache2 stop
996 | [[ $(command -v apache2) ]] && apt-get remove apache2* -y
997 | fi
998 | fi
999 | [[ $caddy ]] && install_caddy
1000 | get_ip
1001 | config
1002 | show_config_info
1003 | }
1004 | uninstall() {
1005 |
1006 | if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup && -d /etc/v2ray/233boy/v2ray ]]; then
1007 | . $backup
1008 | if [[ $mark ]]; then
1009 | _load uninstall.sh
1010 | else
1011 | echo
1012 | echo -e " $yellow输入 ${cyan}v2ray uninstall${none} $yellow即可卸载${none}"
1013 | echo
1014 | fi
1015 |
1016 | elif [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f /etc/v2ray/233blog_v2ray_backup.txt && -d /etc/v2ray/233boy/v2ray ]]; then
1017 | echo
1018 | echo -e " $yellow输入 ${cyan}v2ray uninstall${none} $yellow即可卸载${none}"
1019 | echo
1020 | else
1021 | echo -e "
1022 | $red 大胸弟...你貌似毛有安装 V2Ray ....卸载个鸡鸡哦...$none
1023 |
1024 | 备注...仅支持卸载使用我 (v2ray6.com) 提供的 V2Ray 一键安装脚本
1025 | " && exit 1
1026 | fi
1027 |
1028 | }
1029 |
1030 | args=$1
1031 | [ -z $1 ] && args="online"
1032 | case $args in
1033 | online)
1034 | #hello world
1035 | ;;
1036 | local)
1037 | local_install=true
1038 | ;;
1039 | *)
1040 | echo
1041 | echo -e " 你输入的这个参数 <$red $args $none> ...这个是什么鬼啊...脚本不认识它哇"
1042 | echo
1043 | echo -e " 这个辣鸡脚本仅支持输入$green local / online $none参数"
1044 | echo
1045 | echo -e " 输入$yellow local $none即是使用本地安装"
1046 | echo
1047 | echo -e " 输入$yellow online $none即是使用在线安装 (默认)"
1048 | echo
1049 | exit 1
1050 | ;;
1051 | esac
1052 |
1053 | clear
1054 | while :; do
1055 | echo
1056 | echo "........... V2Ray 一键安装脚本 & 管理脚本 by v2ray6.com .........."
1057 | echo
1058 | echo "帮助说明: https://v2ray6.com/post/1/"
1059 | echo
1060 | echo "搭建教程: https://v2ray6.com/post/2/"
1061 | echo
1062 | echo " 1. 安装"
1063 | echo
1064 | echo " 2. 卸载"
1065 | echo
1066 | if [[ $local_install ]]; then
1067 | echo -e "$yellow 温馨提示.. 本地安装已启用 ..$none"
1068 | echo
1069 | fi
1070 | read -p "$(echo -e "请选择 [${magenta}1-2$none]:")" choose
1071 | case $choose in
1072 | 1)
1073 | install
1074 | break
1075 | ;;
1076 | 2)
1077 | uninstall
1078 | break
1079 | ;;
1080 | *)
1081 | error
1082 | ;;
1083 | esac
1084 | done
1085 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
--------------------------------------------------------------------------------