{"action":"created","issue":{"url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/1065","repository_url":"https://api.github.com/repos/KeepSafe/aiohttp","labels_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/1065/labels{/name}","comments_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/1065/comments","events_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/1065/events","html_url":"https://github.com/KeepSafe/aiohttp/issues/1065","id":170511044,"number":1065,"title":"[uvloop] aiohttp client and proxy - TimeoutError","user":{"login":"estin","id":520814,"avatar_url":"https://avatars.githubusercontent.com/u/520814?v=3","gravatar_id":"","url":"https://api.github.com/users/estin","html_url":"https://github.com/estin","followers_url":"https://api.github.com/users/estin/followers","following_url":"https://api.github.com/users/estin/following{/other_user}","gists_url":"https://api.github.com/users/estin/gists{/gist_id}","starred_url":"https://api.github.com/users/estin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estin/subscriptions","organizations_url":"https://api.github.com/users/estin/orgs","repos_url":"https://api.github.com/users/estin/repos","events_url":"https://api.github.com/users/estin/events{/privacy}","received_events_url":"https://api.github.com/users/estin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-08-10T20:29:03Z","updated_at":"2016-08-11T15:28:46Z","closed_at":null,"body":"When fetch url with proxy and uvloop like this:\r\n```python\r\nimport asyncio\r\nimport uvloop\r\nasyncio.set_event_loop_policy(uvloop.EventLoopPolicy())\r\n\r\nimport aiohttp\r\n\r\nasync def fetch(session, url):\r\n    with aiohttp.Timeout(10):\r\n        async with session.get(url) as response:\r\n            return await response.text()\r\n\r\nasync def main_with_proxy(loop):\r\n    conn = aiohttp.ProxyConnector(proxy=\"http://127.0.0.1:1091\")\r\n    async with aiohttp.ClientSession(connector=conn, loop=loop) as session:\r\n        html = await fetch(session, 'http://python.org')\r\n        print(html)\r\n\r\nif __name__ == '__main__':\r\n    loop = asyncio.get_event_loop()\r\n    loop.run_until_complete(main_with_proxy(loop))\r\n```\r\n\r\nResult:\r\n```python\r\nTraceback (most recent call last):\r\n  File \"uvloop-test.py\", line 26, in <module>\r\n    loop.run_until_complete(main_with_proxy(loop))\r\n  File \"uvloop/loop.pyx\", line 1133, in uvloop.loop.Loop.run_until_complete (uvloop/loop.c:19911)\r\n  File \"uvloop/future.pyx\", line 123, in uvloop.loop.BaseFuture.result (uvloop/loop.c:93421)\r\n  File \"uvloop/future.pyx\", line 78, in uvloop.loop.BaseFuture._result_impl (uvloop/loop.c:92960)\r\n  File \"uvloop/task.pyx\", line 128, in uvloop.loop.BaseTask._fast_step (uvloop/loop.c:98739)\r\n  File \"uvloop-test.py\", line 15, in main_with_proxy\r\n    html = await fetch(session, 'http://python.org')\r\n  File \"uvloop-test.py\", line 10, in fetch\r\n    return await response.text()\r\n  File \"/root/lib/python3.5/site-packages/aiohttp-0.22.5-py3.5-linux-x86_64.egg/aiohttp/helpers.py\", line 564, in __exit__\r\n    raise asyncio.TimeoutError from None\r\nconcurrent.futures._base.TimeoutError\r\n```\r\n\r\nBut on same proxy with curl:\r\n```bash\r\n$ curl -v --proxy 127.0.0.1:1091 --url http://python.org/\r\n* Hostname was NOT found in DNS cache\r\n*   Trying 127.0.0.1...\r\n* Connected to 127.0.0.1 (127.0.0.1) port 1091 (#0)\r\n> GET http://python.org/ HTTP/1.1\r\n> User-Agent: curl/7.38.0\r\n> Host: python.org\r\n> Accept: */*\r\n> Proxy-Connection: Keep-Alive\r\n> \r\n< HTTP/1.1 301 Moved Permanently\r\n< DeleGate-Ver: 9.9.13 (delay=0)\r\n< Location: https://python.org/\r\n< Content-length: 0\r\n< Via: 1.1 - (DeleGate/9.9.13)\r\n* HTTP/1.1 proxy connection set close!\r\n< Proxy-Connection: close\r\n< \r\n* Closing connection 0\r\n```\r\n\r\nEnvironment\r\n```bash\r\nPython 3.5.1\r\naiohttp 0.22.5\r\nuvloop 0.5.1\r\n```\r\n\r\nWhere\r\n - aiohttp with uvloop, but without proxy works\r\n - aiohttp with proxy, but wihout uvloop works"},"comment":{"url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/comments/239196788","html_url":"https://github.com/KeepSafe/aiohttp/issues/1065#issuecomment-239196788","issue_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/1065","id":239196788,"user":{"login":"1st1","id":239003,"avatar_url":"https://avatars.githubusercontent.com/u/239003?v=3","gravatar_id":"","url":"https://api.github.com/users/1st1","html_url":"https://github.com/1st1","followers_url":"https://api.github.com/users/1st1/followers","following_url":"https://api.github.com/users/1st1/following{/other_user}","gists_url":"https://api.github.com/users/1st1/gists{/gist_id}","starred_url":"https://api.github.com/users/1st1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1st1/subscriptions","organizations_url":"https://api.github.com/users/1st1/orgs","repos_url":"https://api.github.com/users/1st1/repos","events_url":"https://api.github.com/users/1st1/events{/privacy}","received_events_url":"https://api.github.com/users/1st1/received_events","type":"User","site_admin":false},"created_at":"2016-08-11T15:28:46Z","updated_at":"2016-08-11T15:28:46Z","body":"Hi, thanks for reporting this.  What kind of proxy do I need to use to reproduce this?"}}
{"actor":{"display_login":"1st1"}}