equal
deleted
inserted
replaced
98 """ |
98 """ |
99 response = b'' |
99 response = b'' |
100 if "SOCKS" in os.environ: |
100 if "SOCKS" in os.environ: |
101 try: |
101 try: |
102 import socks |
102 import socks |
103 except Exception as e: |
103 except ImportError as e: |
104 print(str(e)) |
104 print("You need to install the Python socks module. Install PIP (https://bootstrap.pypa.io/get-pip.py) and then 'pip install PySocks'") |
105 print("You need to install the Python socks module. Install PIP (https://bootstrap.pypa.io/get-pip.py). Then 'pip install PySocks' ") |
105 raise e |
106 sys.exit(0) |
106 socksproxy, port = os.environ["SOCKS"].split(":") |
107 socksproxy,port = os.environ["SOCKS"].split(":") |
|
108 s = socks.socksocket() |
107 s = socks.socksocket() |
109 s.set_proxy(socks.SOCKS5, socksproxy, int(port)) |
108 s.set_proxy(socks.SOCKS5, socksproxy, int(port)) |
110 else: |
109 else: |
111 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
110 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
112 s.settimeout(10) |
111 s.settimeout(10) |