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

能否添加前置代理 #4

Open
eve2ptp opened this issue Jan 24, 2023 · 1 comment
Open

能否添加前置代理 #4

eve2ptp opened this issue Jan 24, 2023 · 1 comment

Comments

@eve2ptp
Copy link

eve2ptp commented Jan 24, 2023

screen 模式可以设置终端代理,但 systemd 直连会被墙(局域网树莓派)

@eve2ptp
Copy link
Author

eve2ptp commented Jan 24, 2023

目前在 urllib 和 requests 的调用方法这里加上代理链,能正常工作

proxy_support` = urllib.request.ProxyHandler({
    'http' : 'http://127.0.0.1:7890',
    'https': 'https://127.0.0.1:7890'
})
opener = urllib.request.build_opener(proxy_support)
urllib.request.install_opener(opener)

def main():
    updater = Updater(TOKEN, use_context=True, request_kwargs={"proxy_url": "http://127.0.0.1:7890"})

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

1 participant