kelvinben / autoredtools Goto Github PK
View Code? Open in Web Editor NEWAutoRedTools是一款轻量级一站式自动下载/自动更新常用开源软件的工具,主要帮助安全从业者/安全开发人员快速进行环境搭建以及常用软件的更新,节约软件的更新或者安 装的时间,从而提升生产效率或工作效率。
AutoRedTools是一款轻量级一站式自动下载/自动更新常用开源软件的工具,主要帮助安全从业者/安全开发人员快速进行环境搭建以及常用软件的更新,节约软件的更新或者安 装的时间,从而提升生产效率或工作效率。
报错信息如下:
检测到使用代理:socks5://*.*.*.*:port 配置错误,请检查无误后再重试!!!
报错位置应该是下面的函数:
def __check_proxy__(self) -> bool:
try:
proxies = {"http": self.proxy,"https": self.proxy}
requests.get("https://www.google.com",proxies=proxies)
except Exception as e:
error_msg = "检测到使用代理:%s 配置错误,请检查无误后再重试!!!" % (self.proxy)
raise CustomException(error_msg)
问了GPT,回答是:
_上述代码中的requests.get()方法默认使用的是HTTP代理,而不是SOCKS5代理。因此,如果你传入一个SOCKS5代理地址,这段代码将无法正确执行。
要在requests库中使用SOCKS5代理,你可以使用第三方库requests-socks来实现。下面是修改后的代码示例_:
import requests
from requests.exceptions import RequestException
from requests_sock import SocksiPyHandler
def __check_proxy__(self) -> bool:
try:
proxies = {
'http': self.proxy,
'https': self.proxy,
}
session = requests.Session()
session.mount('http://', SocksiPyHandler(socks.SOCKS5, self.proxy))
session.mount('https://', SocksiPyHandler(socks.SOCKS5, self.proxy))
session.get("https://www.google.com", proxies=proxies)
except RequestException as e:
error_msg = "检测到使用代理:%s 配置错误,请检查无误后再重试!!!" % (self.proxy)
raise CustomException(error_msg)
return True
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.