-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.sh
70 lines (58 loc) · 1.35 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
#ulimit -HSn 65536
#ulimit -n
#checkversion
#openssl version
#stunnel -version
#download
wget https://www.stunnel.org/downloads/stunnel-5.36.tar.gz --no-check-certificate
wget https://github.com/z3APA3A/3proxy/archive/3proxy-0.8.7.tar.gz
tar zxvf stunnel-5.36.tar.gz
tar zxvf 3proxy-0.8.7.tar.gz
yum install openssl openssl-devel
#yum install openssl*
#3proxy
cd 3proxy-3proxy-0.8.7
make -f Makefile.Linux
make -f Makefile.Linux install
cat > /etc/3proxy.cfg << EOF
internal 127.0.0.1
auth none
socks -p22222
EOF
#3proxy /etc/3proxy.cfg &
cd ../stunnel-5.36
#stunnel
./configure
make
make install
cat > /usr/local/etc/stunnel/stunnel.conf << EOF
socket = l:TCP_NODELAY=1
#for client
#socket = r:TCP_NODELAY=1
output = /usr/local/etc/stunnel/stunnel.log
cert = /usr/local/etc/stunnel/stunnel.pem
pid = /usr/local/etc/stunnel/stunnel.pid
[proxy]
accept = 443
connect = 22222
EOF
# linux must setting pid
#/usr/local/bin/stunnel
#ps -ef | grep stunnel
# add auto start after reboot
cat > /etc/rc.local << EOF
/usr/local/bin/stunnel
/usr/local/bin/3proxy /etc/3proxy.cfg -osTCP_NODELAY -ocTCP_NODELAY &
EOF
#add iptables rule
#iptables -I INPUT -p tcp --dport 443 -j ACCEPT
#iptables -L -n
#service iptables save
#check port
#netstat -ntlp
#make cert
#openssl gendh 2048 >> stunnel.pem
#http://www.stunnel.org/howto.html
#highload
#https://3proxy.ru/highload.asp