{"action":"closed","issue":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/2336","labels_url":"https://api.github.com/repos/kennethreitz/requests/issues/2336/labels{/name}","comments_url":"https://api.github.com/repos/kennethreitz/requests/issues/2336/comments","events_url":"https://api.github.com/repos/kennethreitz/requests/issues/2336/events","html_url":"https://github.com/kennethreitz/requests/issues/2336","id":48629128,"number":2336,"title":"Timeout for connecting to proxy","user":{"login":"glaslos","id":716339,"avatar_url":"https://avatars.githubusercontent.com/u/716339?v=3","gravatar_id":"","url":"https://api.github.com/users/glaslos","html_url":"https://github.com/glaslos","followers_url":"https://api.github.com/users/glaslos/followers","following_url":"https://api.github.com/users/glaslos/following{/other_user}","gists_url":"https://api.github.com/users/glaslos/gists{/gist_id}","starred_url":"https://api.github.com/users/glaslos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glaslos/subscriptions","organizations_url":"https://api.github.com/users/glaslos/orgs","repos_url":"https://api.github.com/users/glaslos/repos","events_url":"https://api.github.com/users/glaslos/events{/privacy}","received_events_url":"https://api.github.com/users/glaslos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kennethreitz/requests/labels/Bug","name":"Bug","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2014-11-13T12:10:06Z","updated_at":"2015-03-02T09:49:24Z","closed_at":"2015-03-02T09:49:24Z","body":"I provided a bogus proxy, set a very short timeout and expected requests to fail very fast. Unfortunately the opposite happened. Is this behavior intentional? As far as I can tell there is no way to set a timeout for the proxy connection.\r\n\r\n```Python\r\ntime python -c \"import requests; print requests.__version__; requests.get('https://google.com', timeout=0.01, proxies={'https':'https://1.1.1.1'})\"\r\n2.4.3\r\nTraceback (most recent call last):\r\n  File \"<string>\", line 1, in <module>\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 60, in get\r\n    return request('get', url, **kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 49, in request\r\n    return session.request(method=method, url=url, **kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 457, in request\r\n    resp = self.send(prep, **send_kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 569, in send\r\n    r = adapter.send(request, **kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/requests/adapters.py\", line 413, in send\r\n    raise ConnectionError(e, request=request)\r\nrequests.exceptions.ConnectionError: HTTPSConnectionPool(host='google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', error(110, 'Connection timed out')))\r\n\r\nreal\t2m7.350s\r\nuser\t0m0.090s\r\nsys\t0m0.030s\r\n```"}}