From 96050ac8da48a194ef9161f666464a4ab750f6c4 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Fri, 11 Feb 2022 19:59:18 +0800 Subject: [PATCH] fix: client stop socks connection first --- ProxyChecker/Http.py | 6 +----- check.py | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ProxyChecker/Http.py b/ProxyChecker/Http.py index dfe12e0..c43c512 100644 --- a/ProxyChecker/Http.py +++ b/ProxyChecker/Http.py @@ -25,10 +25,6 @@ def httpPing(port, url = 'http://gstatic.com/generate_204', timeout = 30): return None, 'Missing modules' except requests.exceptions.InvalidSchema: # 缺失pysocks包 return None, 'Missing dependencies for SOCKS support' - except requests.exceptions.ConnectionError: # socks端口出错 - return None, 'Unable to connect socks5 proxy' - except requests.exceptions.ProxyError: # socks代理出错 - return None, 'Unable to connect socks5 proxy' except requests.exceptions.ConnectTimeout: # 请求超时 return False, 'Request timeout' except requests.exceptions.ReadTimeout: # 请求超时 @@ -36,7 +32,7 @@ def httpPing(port, url = 'http://gstatic.com/generate_204', timeout = 30): except requests.exceptions.Timeout: # 请求超时 return False, 'Request timeout' except: # 未知错误 - return None, 'Unknown error' + return False, 'Request error' try: statusCode = httpRequest.status_code # 获取http状态码 diff --git a/check.py b/check.py index 2ffc5d5..4d72dc2 100644 --- a/check.py +++ b/check.py @@ -58,7 +58,7 @@ def loadDir(folderPath): # 创建文件夹 def proxyHttpCheck(socksPort): # Http检测 try: - health, httpDelay = Checker.httpCheck(socksPort, timeout = 10) + health, httpDelay = Checker.httpCheck(socksPort, timeout = 12) if health == None: # 连接失败 return None return {