ERROR - TeleBot: "ProxyError occurred  Caused by ProxyError('Cannot connect to proxy.', [Errno 11001]

Hello,
I was trying to create a new bot. 
It was running correctly, but when I run the code today, which was just copying the message which is written, it failed to run due to some proxy issues

import config
import telebot

bot = telebot.TeleBot(config.token)


@bot.message_handler(content_types=["text"])
def repeat_all_messages(message):  
    bot.send_message(message.chat.id, message.text)


if __name__ == '__main__':
     bot.polling(none_stop=True)

## Expected Result

**the code is running without errors**

## Actual Result

**Proxy issues** 

## Reproduction Steps

```python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) 

 
What was done before - 
I don't use proxy
I installed heroku to run the bot there. 
 and tried to set HTTP_PROXY and HTTPS_proxy 
\\\
set HTTP_PROXY=http://proxy.server.com:portnumber
set HTTPS_PROXY=https://proxy.server.com:portnumber
\\\
that's basically all. 
After this I cannot start the bot successfully  


```

## System Information

    $ python -m requests.help

```
{
  "chardet": {
    "version": "3.0.4"
  },
  "cryptography": {
    "version": ""
  },
  "idna": {
    "version": "2.6"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.5.2"
  },
  "platform": {
    "release": "10",
    "system": "Windows"
  },
  "pyOpenSSL": {
    "openssl_version": "",
    "version": null
  },
  "requests": {
    "version": "2.18.4"
  },
  "system_ssl": {
    "version": "1000208f"
  },
  "urllib3": {
    "version": "1.22"
  },
  "using_pyopenssl": false
}
```

 So the error is : 
2017-10-16 21:34:15,195 (util.py:64 PollingThread) ERROR - TeleBot: "ProxyError occurred, args=(MaxRetryError("HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botXXX:XXX/getUpdates?offset=1&timeout=20 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0351BA10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)))",),)
Traceback (most recent call last):
  File "C:\Python\Python35-32\lib\site-packages\urllib3\connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "C:\Python\Python35-32\lib\site-packages\urllib3\util\connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "C:\Python\Python35-32\lib\socket.py", line 732, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python\Python35-32\lib\site-packages\urllib3\connectionpool.py", line 595, in urlopen
    self._prepare_proxy(conn)
  File "C:\Python\Python35-32\lib\site-packages\urllib3\connectionpool.py", line 816, in _prepare_proxy
    conn.connect()
  File "C:\Python\Python35-32\lib\site-packages\urllib3\connection.py", line 284, in connect
    conn = self._new_conn()
  File "C:\Python\Python35-32\lib\site-packages\urllib3\connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x0351BA10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python\Python35-32\lib\site-packages\requests\adapters.py", line 440, in send
    timeout=timeout
  File "C:\Python\Python35-32\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "C:\Python\Python35-32\lib\site-packages\urllib3\util\retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botxxx:xxxx/getUpdates?offset=1&timeout=20 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0351BA10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python\Python35-32\lib\site-packages\telebot\util.py", line 58, in run
    task(*args, **kwargs)
  File "C:\Python\Python35-32\lib\site-packages\telebot\__init__.py", line 159, in __retrieve_updates
    updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
  File "C:\Python\Python35-32\lib\site-packages\telebot\__init__.py", line 129, in get_updates
    json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
  File "C:\Python\Python35-32\lib\site-packages\telebot\apihelper.py", line 175, in get_updates
    return _make_request(token, method_url, params=payload)
  File "C:\Python\Python35-32\lib\site-packages\telebot\apihelper.py", line 54, in _make_request
    timeout=(connect_timeout, read_timeout), proxies=proxy)
  File "C:Python\Python35-32\lib\site-packages\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Python\Python35-32\lib\site-packages\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "C:\Python\Python35-32\lib\site-packages\requests\adapters.py", line 502, in send
    raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botxxx:xxxx/getUpdates?offset=1&timeout=20 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0351BA10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)))
"
Traceback (most recent call last):
  File "C:\Python\Python35-32\lib\site-packages\urllib3\connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "C:\Python\Python35-32\lib\site-packages\urllib3\util\connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "C:\Python\Python35-32\lib\socket.py", line 732, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python\Python35-32\lib\site-packages\urllib3\connectionpool.py", line 595, in urlopen
    self._prepare_proxy(conn)
  File "C:\Python\Python35-32\lib\site-packages\urllib3\connectionpool.py", line 816, in _prepare_proxy
    conn.connect()
  File "C:\Python\Python35-32\lib\site-packages\urllib3\connection.py", line 284, in connect
    conn = self._new_conn()
  File "C:\Python\Python35-32\lib\site-packages\urllib3\connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x0351BA10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\\Python\Python35-32\lib\site-packages\requests\adapters.py", line 440, in send
    timeout=timeout
  File "C:\\Python\Python35-32\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "C:\\Python\Python35-32\lib\site-packages\urllib3\util\retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botxxx:xxx/getUpdates?offset=1&timeout=20 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0351BA10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/PycharmProjects/QuizPollbot/bot.py", line 34, in <module>
    bot.polling()
  File "C:\\Python\Python35-32\lib\site-packages\telebot\__init__.py", line 264, in polling
    self.__threaded_polling(none_stop, interval, timeout)
  File "C:\\Python\Python35-32\lib\site-packages\telebot\__init__.py", line 287, in __threaded_polling
    polling_thread.raise_exceptions()
  File "C:\\Python\Python35-32\lib\site-packages\telebot\util.py", line 77, in raise_exceptions
    six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
  File "C:\\Python\Python35-32\lib\site-packages\six.py", line 693, in reraise
    raise value
  File "C:\\Python\Python35-32\lib\site-packages\telebot\util.py", line 58, in run
    task(*args, **kwargs)
  File "C:\\Python\Python35-32\lib\site-packages\telebot\__init__.py", line 159, in __retrieve_updates
    updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
  File "C:\\Python\Python35-32\lib\site-packages\telebot\__init__.py", line 129, in get_updates
    json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
  File "C:\\Python\Python35-32\lib\site-packages\telebot\apihelper.py", line 175, in get_updates
    return _make_request(token, method_url, params=payload)
  File "C:\\Python\Python35-32\lib\site-packages\telebot\apihelper.py", line 54, in _make_request
    timeout=(connect_timeout, read_timeout), proxies=proxy)
  File "C:\\Python\Python35-32\lib\site-packages\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\\Python\Python35-32\lib\site-packages\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "C:\\Python\Python35-32\lib\site-packages\requests\adapters.py", line 502, in send
    raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botxxx:xxx/getUpdates?offset=1&timeout=20 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0351BA10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)))

Process finished with exit code 1






I saw the issue #2875 with the same error 1101, but in my code I did not set the proxy 
I saw the issue #3990  again it was set in code to use proxy ( not my situation)

hope that I provided all possible information. 

getaddrinfo is failing. This means you are failing the DNS lookup. are you sure the proxy hostname is resolvable from your host?

Without any new information, I'm going to close this. Of course, if you're able to provide new information, @falconych we can reopen this and resume investigation.

Cheers,
Ian