mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-01-08 04:04:42 +02:00
update proxyhub
This commit is contained in:
parent
0381b4157a
commit
9b175b6a4d
@ -9,16 +9,17 @@ RUN apt-get update
|
||||
RUN apt-get install -y build-essential pdnsd haproxy polipo nginx python
|
||||
RUN apt-get clean
|
||||
|
||||
ADD ./haproxy.cfg /etc/haproxy/
|
||||
ADD ./pdnsd.conf /etc/
|
||||
ADD ./polipo.conf /etc/polipo/config
|
||||
ADD ./shadowsocks.json /etc/
|
||||
ADD ./supervisord.conf /etc/supervisor/
|
||||
ADD ./services.ini /etc/supervisor/conf.d/
|
||||
ADD ./pdnsd.conf /etc/
|
||||
ADD ./shadowsocks /etc/shadowsocks
|
||||
ADD ./haproxy.cfg /etc/haproxy/
|
||||
ADD ./polipo.conf /etc/polipo/config
|
||||
|
||||
ADD http://stedolan.github.io/jq/download/linux64/jq /usr/local/bin/
|
||||
ADD https://bootstrap.pypa.io/get-pip.py /tmp/pkgs/
|
||||
ADD https://download.libsodium.org/libsodium/releases/libsodium-1.0.2.tar.gz /tmp/pkgs/
|
||||
ADD http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy-1.4.3.tar.gz /tmp/pkgs/
|
||||
ADD https://bootstrap.pypa.io/get-pip.py /tmp/pkgs/
|
||||
|
||||
WORKDIR /tmp/pkgs/
|
||||
RUN python get-pip.py
|
||||
|
@ -35,3 +35,8 @@ ProxyHub
|
||||
# http(s) proxy
|
||||
curl -x http://localhost:8123 https://www.youtube.com
|
||||
|
||||
## Todo
|
||||
|
||||
- add proxy.pac via nginx
|
||||
- add transparent socks5 proxy via redsocks
|
||||
|
||||
|
0
proxyhub/nginx.conf
Normal file
0
proxyhub/nginx.conf
Normal file
@ -8,9 +8,9 @@ command = pdnsd -c /etc/pdnsd.conf
|
||||
|
||||
[program:shadowsocks]
|
||||
priority = 300
|
||||
command = sslocal -c /etc/shadowsocks/%(process_num)d.json
|
||||
numprocs_start = 1982
|
||||
numprocs = 4
|
||||
command = bash -c 'sslocal -c <(jq "select(.local_port==%(process_num)d)" /etc/shadowsocks.json)'
|
||||
numprocs_start = 1981
|
||||
numprocs = 5
|
||||
process_name = %(process_num)d
|
||||
|
||||
[program:haproxy]
|
||||
|
40
proxyhub/shadowsocks.json
Normal file
40
proxyhub/shadowsocks.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"local_address": "127.0.0.1",
|
||||
"local_port": 1981,
|
||||
"server": "107.191.53.58",
|
||||
"server_port": 1789,
|
||||
"password": "123_FUCK_gfw",
|
||||
"method": "aes-192-cfb"
|
||||
}
|
||||
{
|
||||
"local_address": "127.0.0.1",
|
||||
"local_port": 1982,
|
||||
"server": "104.238.180.87",
|
||||
"server_port": 1789,
|
||||
"password": "123_FUCK_gfw",
|
||||
"method": "aes-192-cfb"
|
||||
}
|
||||
{
|
||||
"local_address": "127.0.0.1",
|
||||
"local_port": 1983,
|
||||
"server": "74.82.164.182",
|
||||
"server_port": 11150,
|
||||
"password": "17112730",
|
||||
"method": "aes-256-cfb"
|
||||
}
|
||||
{
|
||||
"local_address": "127.0.0.1",
|
||||
"local_port": 1984,
|
||||
"server": "104.143.15.84",
|
||||
"server_port": 30500,
|
||||
"password": "123456",
|
||||
"method": "aes-256-cfb"
|
||||
}
|
||||
{
|
||||
"local_address": "127.0.0.1",
|
||||
"local_port": 1985,
|
||||
"server": "167.160.165.189",
|
||||
"server_port": 8883,
|
||||
"password": "whoisyourbitch",
|
||||
"method": "table"
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"server": "free1.5z3.pw",
|
||||
"server_port": 443,
|
||||
"local_address": "127.0.0.1",
|
||||
"local_port": 1982,
|
||||
"password": "fogss.com",
|
||||
"method": "rc4-md5",
|
||||
"timeout": 600
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"server": "ova.pw",
|
||||
"server_port": 8388,
|
||||
"local_address": "127.0.0.1",
|
||||
"local_port": 1983,
|
||||
"password": "goagent",
|
||||
"method": "aes-256-cfb",
|
||||
"timeout": 600
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"server": "107.191.53.58",
|
||||
"server_port": 1789,
|
||||
"local_address": "127.0.0.1",
|
||||
"local_port": 1984,
|
||||
"password": "123_FUCK_gfw",
|
||||
"method": "aes-192-cfb"
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"server": "104.238.180.87",
|
||||
"server_port": 1789,
|
||||
"local_address": "127.0.0.1",
|
||||
"local_port": 1985,
|
||||
"password": "123_FUCK_gfw",
|
||||
"method": "aes-192-cfb"
|
||||
}
|
@ -21,6 +21,7 @@ import base64
|
||||
import json
|
||||
import os.path
|
||||
import socket
|
||||
import sys
|
||||
import time
|
||||
|
||||
|
||||
@ -73,9 +74,9 @@ def gen_config(args, bind, port, enc):
|
||||
|
||||
if enc:
|
||||
uri = '{0[method]}:{0[password]}@{0[server]}:{0[server_port]}'.format(args)
|
||||
print 'ss://' + base64.encodestring(uri).rstrip('=\n')
|
||||
return 'ss://' + base64.encodestring(uri).rstrip('=\n')
|
||||
else:
|
||||
print json.dumps({
|
||||
return json.dumps({
|
||||
'local_address': bind,
|
||||
'local_port': port or random_port(),
|
||||
'server': args['server'],
|
||||
@ -92,6 +93,7 @@ if __name__ == '__main__':
|
||||
parser.add_argument('-w', '--wait', type=int, default=1)
|
||||
parser.add_argument('-e', '--encode', action='store_true', default=False)
|
||||
parser.add_argument('-n', '--dryrun', action='store_true', default=False)
|
||||
parser.add_argument('-q', '--quiet', action='store_true', default=False)
|
||||
parser.add_argument('-b', '--bind', type=str, default='127.0.0.1')
|
||||
parser.add_argument('-p', '--port', type=int, default=0)
|
||||
parser.add_argument('uri')
|
||||
@ -117,6 +119,10 @@ if __name__ == '__main__':
|
||||
proc.process.kill()
|
||||
|
||||
if ok:
|
||||
gen_config(param, args.bind, args.port, args.encode)
|
||||
print gen_config(param, args.bind, args.port, args.encode)
|
||||
|
||||
if not args.quiet:
|
||||
print >> sys.stderr, '[{}] is {}'.format(param['server'], 'good' if ok else 'bad')
|
||||
|
||||
exit(0 if ok else 1)
|
||||
|
Loading…
Reference in New Issue
Block a user