Skip to content

Commit 5519764

Browse files
author
qiyeboy
committed
修复bug
1 parent b89d9ab commit 5519764

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

validator/Validator.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def detect_proxy(selfip, proxy, queue2=None):
9191
protocol, types, speed = getattr(sys.modules[__name__],config.CHECK_PROXY['function'])(selfip, proxies)#checkProxy(selfip, proxies)
9292
if protocol >= 0:
9393
proxy['protocol'] = protocol
94-
proxy['type'] = types
94+
proxy['types'] = types
9595
proxy['speed'] = speed
9696
else:
9797
proxy = None
@@ -146,7 +146,6 @@ def _checkHttpProxy(selfip, proxies, isHttp=True):
146146
headers = content['headers']
147147
ip = content['origin']
148148
proxy_connection = headers.get('Proxy-Connection', None)
149-
150149
if ',' in ip:
151150
types = 2
152151
elif proxy_connection:
@@ -213,7 +212,11 @@ def getMyIP():
213212

214213

215214
if __name__ == '__main__':
216-
getMyIP()
215+
ip = '222.186.161.132'
216+
port = 3128
217+
proxies = {"http": "http://%s:%s" % (ip, port), "https": "http://%s:%s" % (ip, port)}
218+
_checkHttpProxy(None,proxies)
219+
# getMyIP()
217220
# str="{ip:'61.150.43.121',address:'陕西省西安市 西安电子科技大学'}"
218221
# j = json.dumps(str)
219222
# str = j['ip']

0 commit comments

Comments
 (0)