-
Notifications
You must be signed in to change notification settings - Fork 349
Use system proxy if set #57
Comments
The requests need to go through the VPN proxy. We could add something like this. Is this the same error you get when trying to connect without a proxy? |
Yes it is, it is also the same error when you are not connected to the internet |
As per a quick fix, you can set the following lines before instantiating the Bot object:
Change the proxy url/port and you should be good to go. Tell me how it goes |
Thanks for your quick response, I wanna ask, how should I set the proxy url? I mean from where I can get a proxy server? Is there a way my bot can use the VPN that the user is using? As to my knowledge, I dont know a free proxy server which is stable enough to use in the rat |
Yes, there is a way to connect to a VPN that is not on your local computer. For this, you need a proxy server running publicly. The |
Hi
First of all, thank you Ritiek for your great project, I really love it,
yesterday I started to work with this bot, and I have my but running on VPS, and everything works find, except one thing.
As you guys may know Telegram is banned in some countries, and users from those countries use VPN in order to use the telegram. However, I gave this but to a friend of mine which lives in a country where Telegram is banned, and he got errors from the console, which indicated that couldn't establish a connection. Notice that he also had a VPN running, but still had the same problem. I wanna know is there a way around this? As I'm a beginner in Python, I can use your help to improve my rat.
`Traceback (most recent call last):
File "site-packages\telepot_init_.py", line 1183, in get_from_telegram_server
File "site-packages\telepot_init_.py", line 1000, in getUpdates
File "site-packages\telepot_init_.py", line 491, in _api_request
File "site-packages\telepot\api.py", line 154, in request
File "site-packages\urllib3\request.py", line 150, in request_encode_body
File "site-packages\urllib3\poolmanager.py", line 323, in urlopen
File "site-packages\urllib3\connectionpool.py", line 667, in urlopen
File "site-packages\urllib3\connectionpool.py", line 667, in urlopen
File "site-packages\urllib3\connectionpool.py", line 667, in urlopen
File "site-packages\urllib3\connectionpool.py", line 638, in urlopen
File "site-packages\urllib3\util\retry.py", line 398, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot716427487:AAHi_7vtN8i7m8ET_E7vukMGaFETqo7FHh4/getUpdates (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x061944D0>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))
Traceback (most recent call last):
File "site-packages\urllib3\connection.py", line 159, in _new_conn
File "site-packages\urllib3\util\connection.py", line 57, in create_connection
File "socket.py", line 748, in getaddrinfo
socket.gaierror: [Errno 11002] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "site-packages\urllib3\connectionpool.py", line 600, in urlopen
File "site-packages\urllib3\connectionpool.py", line 343, in _make_request
File "site-packages\urllib3\connectionpool.py", line 839, in _validate_conn
File "site-packages\urllib3\connection.py", line 301, in connect
File "site-packages\urllib3\connection.py", line 168, in _new_conn
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x05C61F90>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "site-packages\telepot_init_.py", line 1183, in get_from_telegram_server
File "site-packages\telepot_init_.py", line 1000, in getUpdates
File "site-packages\telepot_init_.py", line 491, in _api_request
File "site-packages\telepot\api.py", line 154, in request
File "site-packages\urllib3\request.py", line 150, in request_encode_body
File "site-packages\urllib3\poolmanager.py", line 323, in urlopen
File "site-packages\urllib3\connectionpool.py", line 667, in urlopen
File "site-packages\urllib3\connectionpool.py", line 667, in urlopen
File "site-packages\urllib3\connectionpool.py", line 667, in urlopen
File "site-packages\urllib3\connectionpool.py", line 638, in urlopen
File "site-packages\urllib3\util\retry.py", line 398, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot716427487:AAHi_7vtN8i7m8ET_E7vukMGaFETqo7FHh4/getUpdates (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x05C61F90>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))
Traceback (most recent call last):
File "site-packages\urllib3\connection.py", line 159, in _new_conn
File "site-packages\urllib3\util\connection.py", line 57, in create_connection
File "socket.py", line 748, in getaddrinfo
socket.gaierror: [Errno 11002] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "site-packages\urllib3\connectionpool.py", line 600, in urlopen
File "site-packages\urllib3\connectionpool.py", line 343, in _make_request
File "site-packages\urllib3\connectionpool.py", line 839, in _validate_conn
File "site-packages\urllib3\connection.py", line 301, in connect
File "site-packages\urllib3\connection.py", line 168, in _new_conn
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x061E9BF0>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "site-packages\telepot_init_.py", line 1183, in get_from_telegram_server
File "site-packages\telepot_init_.py", line 1000, in getUpdates
File "site-packages\telepot_init_.py", line 491, in _api_request
File "site-packages\telepot\api.py", line 154, in request
File "site-packages\urllib3\request.py", line 150, in request_encode_body
File "site-packages\urllib3\poolmanager.py", line 323, in urlopen
File "site-packages\urllib3\connectionpool.py", line 667, in urlopen
File "site-packages\urllib3\connectionpool.py", line 667, in urlopen
File "site-packages\urllib3\connectionpool.py", line 667, in urlopen
File "site-packages\urllib3\connectionpool.py", line 638, in urlopen
File "site-packages\urllib3\util\retry.py", line 398, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot716427487:AAHi_7vtN8i7m8ET_E7vukMGaFETqo7FHh4/getUpdates (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x061E9BF0>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))`
The text was updated successfully, but these errors were encountered: