Skip to content

Commit f8b0fae

Browse files
committed
Fix bugs
1 parent 5b77e39 commit f8b0fae

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

Dockerfile

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@ FROM ubuntu:18.10
22
MAINTAINER Jiaming Li <ljm625@gmail.com>
33
ENV NGINX_VERSION 1.9.11-1~jessie
44
RUN apt-get update
5-
RUN apt-get install -y ca-certificates nginx gettext-base vim supervisor python3.6 python3.6-dev python3-pip libyaml-dev
5+
RUN apt-get install -y ca-certificates nginx gettext-base vim supervisor python3.6 python3.6-dev python3-pip libyaml-dev build-essential chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
6+
# Do phantomjs
7+
RUN apt-get install -y wget
8+
RUN cd ~
9+
ENV PHANTOM_JS phantomjs-2.1.1-linux-x86_64
10+
RUN wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2
11+
RUN tar xvjf $PHANTOM_JS.tar.bz2
12+
RUN mv $PHANTOM_JS /usr/local/share
13+
RUN ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
614
# forward request and error logs to docker log collector
715
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
816
&& ln -sf /dev/stderr /var/log/nginx/error.log

components/proxy_checker.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ def yaml_loader(file):
4747

4848
def validate_proxy(self,proxy,check=False):
4949
def build_proxy():
50-
if proxy[2]=='http':
51-
return {"http": "socks5://{}:{}".format(proxy[0],proxy[1]),
52-
"https": "socks5://{}:{}".format(proxy[0],proxy[1])}
53-
elif proxy[2]=='socks':
50+
if proxy[2]=='HTTP' or proxy[2]=="HTTPS":
51+
return {"http": "http://{}:{}".format(proxy[0],proxy[1]),
52+
"https": "http://{}:{}".format(proxy[0],proxy[1])}
53+
elif proxy[2]=='SOCKS5':
5454
return {"http": "socks5://{}:{}".format(proxy[0],proxy[1]),
5555
"https": "socks5://{}:{}".format(proxy[0],proxy[1])}
5656
try:

config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ upstream_dns : "8.8.8.8"
8080
# this is useful if u make a public server on the internet and avoid them to use it as a public HTTP Proxy. (Need to use with PAC or DNS)
8181
disable_proxy : false
8282

83+
# Enable socks proxy
84+
enable_socks : true
85+
# Enable http/https proxy
86+
enable_http : true
87+
88+
8389

8490
# Auto Generate Infos.
8591

0 commit comments

Comments
 (0)