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

add socks5h support #22

Open
kuhytitusdlz opened this issue Sep 11, 2019 · 4 comments
Open

add socks5h support #22

kuhytitusdlz opened this issue Sep 11, 2019 · 4 comments

Comments

@kuhytitusdlz
Copy link

hello, telegra.ph is blocked in our country, and we use proxy. So, please add support socks5h, like in https://github.com/python-telegram-bot/python-telegram-bot

REQUEST_KWARGS = {'proxy_url': 'socks5h://127.0.0.1:9050',} updater = Updater(token=TOKEN, request_kwargs=REQUEST_KWARGS, use_context=True)

@python273
Copy link
Owner

It's using requests under the hood, which supports socks5 proxies. I think you can set it via telegraph._telegraph.proxies (also probably you need to pip install requests[socks])

Maybe we can allow to pass TelegraphApi instance to Telegraph via arg. And allow to pass requests session to TelegraphApi. PR is welcome

@kuhytitusdlz
Copy link
Author

it's not working
telegraph._telegraph.proxies = dict(https='socks5h://localhost:9050') AttributeError: 'TelegraphApi' object has no attribute 'proxies'

@python273
Copy link
Owner

oops, it's telegraph._telegraph.session.proxies

@kuhytitusdlz
Copy link
Author

it's works, thanks! goodbye roskomndzor J
telegraph._telegraph.session.proxies = {'https':'socks5h://localhost:9050'}

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

Successfully merging a pull request may close this issue.

2 participants