Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以在python文件里局部使用gg代理吗 #83

Open
zyuh opened this issue Sep 21, 2024 · 2 comments
Open

可以在python文件里局部使用gg代理吗 #83

zyuh opened this issue Sep 21, 2024 · 2 comments

Comments

@zyuh
Copy link

zyuh commented Sep 21, 2024

请问大佬局部使用具体要怎么操作,比如只想在requests.get()时使用,其他时候关闭可以吗

@mzz2017
Copy link
Owner

mzz2017 commented Sep 21, 2024

@zyuh 那你在 requests 的时候设置 http 代理不就好了

@zyuh
Copy link
Author

zyuh commented Sep 21, 2024

@zyuh 那你在 requests 的时候设置 http 代理不就好了

具体原理我也不太懂,我们的服务器是基于docker的,我尝试了一些配置代理的方法都不太好使,用订阅的方式可以,但我不知道requests 的时候怎么设置订阅,我不是学这块的,我上网搜到了下面的方法还是无法访问外网。
proxy = {
"http": 'http://127.0.0.1:7890',
"https": 'https://127.0.0.1:7890',
}
requests.get(url, proxies=proxy)
在proxies这块怎么像gg那样配置订阅呀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants