hongwenjun 3 gadi atpakaļ
vecāks
revīzija
f68402e535

+ 19 - 0
http_proxy/Dockerfile

@@ -0,0 +1,19 @@
+FROM debian:stable-slim
+RUN  apt update -y \
+  && apt install --no-install-recommends --no-install-suggests -y wget shadowsocks-libev supervisor \
+  && wget  -O /usr/bin/brook  https://github.com/txthinking/brook/releases/download/v20210701/brook_linux_amd64  --no-check-certificate \
+  && chmod +x /usr/bin/brook \
+  && apt remove -y wget \
+  && rm -rf /var/lib/apt/lists/*   /var/cache/apt
+
+ADD  http_proxy.tar.gz  /
+
+CMD ["/start.sh"]
+
+##############################################################################
+#  tar cvzf http_proxy.tar.gz  etc/*  http.sh  start.sh
+#  docker build -t http_proxy  .
+
+#  docker run -d -p 58010:58010 --restart=always --name http_proxy  http_proxy
+##############################################################################
+

+ 32 - 0
http_proxy/etc/supervisord.conf

@@ -0,0 +1,32 @@
+[unix_http_server]
+file=/dev/shm/supervisor.sock   ; (the path to the socket file)
+
+[supervisord]
+logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
+logfile_maxbytes=50MB        ; (max main logfile bytes b4 rotation;default 50MB)
+logfile_backups=10           ; (num of main logfile rotation backups;default 10)
+loglevel=info                ; (log level;default info; others: debug,warn,trace)
+pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
+nodaemon=false               ; (start in foreground if true;default false)
+minfds=1024                  ; (min. avail startup file descriptors;default 1024)
+minprocs=200                 ; (min. avail process descriptors;default 200)
+user=root                    ;
+
+[rpcinterface:supervisor]
+supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
+
+[supervisorctl]
+serverurl=unix:///dev/shm/supervisor.sock ; use a unix:// URL  for a unix socket
+
+[program:ss-server]
+command = ss-server -s 127.0.0.1 -p 40000 -k socks5tohttp -m aes-256-gcm -t 300
+autostart=true
+
+[program:ss-local]
+command = ss-local -s 127.0.0.1 -p 40000 -b 127.0.0.1 -l 1080 -k socks5tohttp -m aes-256-gcm -t 300
+autostart=true
+
+[program:socks5tohttp]
+command = brook socks5tohttp -s 127.0.0.1:1080 --listen 0.0.0.0:58010
+autostart=true
+

+ 13 - 0
http_proxy/http.sh

@@ -0,0 +1,13 @@
+# usage:  . http.sh [ip:port]
+
+http_proxy=http://127.0.0.1:58010
+
+if [[ $# > 0 ]]; then
+  http_proxy=http://$1
+fi
+echo "export https_proxy=${http_proxy}"
+
+export http_proxy=$http_proxy
+export https_proxy=$http_proxy
+curl google.com
+

BIN
http_proxy/http_proxy.tar.gz


+ 5 - 0
http_proxy/start.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+# Start supervisord and services
+exec /usr/bin/supervisord -n -c /etc/supervisord.conf
+