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

Can't use socks5h proxy #1516

Closed
404neko opened this issue Sep 16, 2019 · 1 comment · Fixed by #1517
Closed

Can't use socks5h proxy #1516

404neko opened this issue Sep 16, 2019 · 1 comment · Fixed by #1517
Assignees

Comments

@404neko
Copy link

404neko commented Sep 16, 2019

Steps to reproduce

set up a socks5 proxy at 127.0.0.1:1080

from telegram.ext import Updater
REQUEST_KWARGS = {}
REQUEST_KWARGS['proxy_url'] = 'socks5h://127.0.0.1:1080'
updater = Updater('TOKEN', request_kwargs=REQUEST_KWARGS)

Expected behaviour

the bot will run normaly.

Actual behaviour

Throw an exception
Traceback (most recent call last):
File "Core.py", line 125, in
updater = Updater(TOKEN, request_kwargs=REQUEST_KWARGS)
File "D:\Bin\Python\Python37\lib\site-packages\telegram\ext\updater.py", line 135, in init
self._request = Request(**request_kwargs)
File "D:\Bin\Python\Python37\lib\site-packages\telegram\utils\request.py", line 143, in init
mgr = SOCKSProxyManager(proxy_url, **kwargs)
File "D:\Bin\Python\Python37\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\contrib\socks.py", line 160, in init
"Unable to determine SOCKS version from %s" % proxy_url
ValueError: Unable to determine SOCKS version from socks5h://127.0.0.1:1080

Configuration

Operating System:
Win10
python-telegram-bot 12.1.0
requests 2.22.0
setuptools 40.8.0
shiboken2 5.13.1
six 1.12.0
tornado 6.0.3
urllib3 1.25.3

Version of Python, python-telegram-bot & dependencies:

$ python -m telegram

Logs

Insert logs here (if necessary)
python-telegram-bot 12.1.0
certifi 2019.09.11
future 0.17.1
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]

I think python-telegram-bot is using an old urllib3 include in the package localed at
site-packages\telegram\vendor\ptb_urllib3\urllib3
the urllib3 can't handle socks5h

@tsnoam
Copy link
Member

tsnoam commented Sep 17, 2019

@404neko
Thanks for bringing this issue to our attention. It was an unfortunate git mistake which propagated into the release.
Hot fix v12.1.1 had been released.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants