{"action":"created","issue":{"url":"https://api.github.com/repos/Lukasa/hyper/issues/84","labels_url":"https://api.github.com/repos/Lukasa/hyper/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/Lukasa/hyper/issues/84/comments","events_url":"https://api.github.com/repos/Lukasa/hyper/issues/84/events","html_url":"https://github.com/Lukasa/hyper/issues/84","id":57463982,"number":84,"title":"PROTOCOL_ERROR occurred when accessing twitter.com","user":{"login":"t2y","id":96569,"avatar_url":"https://avatars.githubusercontent.com/u/96569?v=3","gravatar_id":"","url":"https://api.github.com/users/t2y","html_url":"https://github.com/t2y","followers_url":"https://api.github.com/users/t2y/followers","following_url":"https://api.github.com/users/t2y/following{/other_user}","gists_url":"https://api.github.com/users/t2y/gists{/gist_id}","starred_url":"https://api.github.com/users/t2y/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t2y/subscriptions","organizations_url":"https://api.github.com/users/t2y/orgs","repos_url":"https://api.github.com/users/t2y/repos","events_url":"https://api.github.com/users/t2y/events{/privacy}","received_events_url":"https://api.github.com/users/t2y/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-12T14:05:47Z","updated_at":"2015-02-12T14:31:37Z","closed_at":"2015-02-12T14:31:37Z","body":"As described in [comments in pull/82](https://github.com/Lukasa/hyper/pull/82#issuecomment-73263780), for some reason, I tried to GET twitter.com, but `PROTOCOL_ERROR` occurred as below.\r\n\r\n```sh\r\n$ hyper --debug https://twitter.com\r\nurl info: {'scheme': 'https', 'host': 'twitter.com', 'port': 443, 'path': '/', 'query': None, 'netloc': 'twitter.com', 'fragment': None}\r\nCommandline Argument: Namespace(_url='https://twitter.com', body=None, debug=True, headers={}, items=[], method='GET', url=<hyper.cli.set_url_info.<locals>.UrlInfo object at 0x10761e5c0>)\r\nSending frame SettingsFrame on stream 0\r\nReceived frame SettingsFrame on stream 0\r\nSending frame SettingsFrame on stream 0\r\nHPACK encoding [(':method', 'GET'), (':scheme', 'https'), (':authority', 'twitter.com'), (':path', '/')]\r\nAdding (b':method', b'GET') to the header table\r\nEncoding 2 with 7 bits.\r\nAdding (b':scheme', b'https') to the header table\r\nEncoding 7 with 7 bits.\r\nAdding (b':authority', b'twitter.com') to the header table\r\nEncoding 1 with 4 bits.\r\nEncoding 8 with 7 bits.\r\nAdding (b':path', b'/') to the header table\r\nEncoding 4 with 7 bits.\r\nEncoded header block to b'\\x82\\x87\\x01\\x88O\\x83%%\\xb1r\\x1e\\x9f\\x84'\r\nSending frame HeadersFrame on stream 1\r\nReceived frame GoAwayFrame on stream 0\r\nTraceback (most recent call last):\r\n  File \"/Users/t2y/.virtualenvs/hyper/bin/hyper\", line 9, in <module>\r\n    load_entry_point('hyper==0.2.0', 'console_scripts', 'hyper')()\r\n  File \"/path/to/hyper/hyper/cli.py\", line 227, in main\r\n    print(request(args))\r\n  File \"/path/to/hyper/hyper/cli.py\", line 215, in request\r\n    response = conn.getresponse()\r\n  File \"/path/to/hyper/hyper/http20/connection.py\", line 171, in getresponse\r\n    return HTTP20Response(stream.getheaders(), stream)\r\n  File \"/path/to/hyper/hyper/http20/stream.py\", line 293, in getheaders\r\n    self._recv_cb()\r\n  File \"/path/to/hyper/hyper/http20/connection.py\", line 580, in _recv_cb\r\n    self._consume_single_frame()\r\n  File \"/path/to/hyper/hyper/http20/connection.py\", line 500, in _consume_single_frame\r\n    self._consume_frame_payload(frame, data)\r\n  File \"/path/to/hyper/hyper/http20/connection.py\", line 566, in _consume_frame_payload\r\n    self.receive_frame(frame)\r\n  File \"/path/to/hyper/hyper/http20/connection.py\", line 372, in receive_frame\r\n    (frame.error_code, frame.additional_data)\r\nhyper.http20.exceptions.ConnectionError: Encountered error 1, extra data b''.\r\n```\r\n\r\nRemoving `ENABLE_PUSH` in the setting frame makes it work. \r\n\r\n```diff\r\ndiff --git a/hyper/http20/connection.py b/hyper/http20/connection.py\r\nindex 659be5f..1d146a8 100644\r\n--- a/hyper/http20/connection.py\r\n+++ b/hyper/http20/connection.py\r\n@@ -208,7 +208,6 @@ class HTTP20Connection(object):\r\n             # connection, followed by an initial settings frame.\r\n             sock.send(b'PRI * HTTP/2.0\\r\\n\\r\\nSM\\r\\n\\r\\n')\r\n             f = SettingsFrame(0)\r\n-            f.settings[SettingsFrame.ENABLE_PUSH] = int(self._enable_push)\r\n             self._send_cb(f)\r\n \r\n             # The server will also send an initial settings frame, so get it.\r\n```\r\n\r\nI couldn't find [http2-17 spec](https://tools.ietf.org/html/draft-ietf-httpbis-http2-17) about why sending `ENABLE_PUSH` causes an error. And then, on other sites, for example https://nghttp2.org/, it works well. I wonder if there's something wrong on server side in twitter.com. I don't know how to inform an issue to twitter.com. So, I just file this as an information for new users."},"comment":{"url":"https://api.github.com/repos/Lukasa/hyper/issues/comments/74079464","html_url":"https://github.com/Lukasa/hyper/issues/84#issuecomment-74079464","issue_url":"https://api.github.com/repos/Lukasa/hyper/issues/84","id":74079464,"user":{"login":"Lukasa","id":1382556,"avatar_url":"https://avatars.githubusercontent.com/u/1382556?v=3","gravatar_id":"","url":"https://api.github.com/users/Lukasa","html_url":"https://github.com/Lukasa","followers_url":"https://api.github.com/users/Lukasa/followers","following_url":"https://api.github.com/users/Lukasa/following{/other_user}","gists_url":"https://api.github.com/users/Lukasa/gists{/gist_id}","starred_url":"https://api.github.com/users/Lukasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lukasa/subscriptions","organizations_url":"https://api.github.com/users/Lukasa/orgs","repos_url":"https://api.github.com/users/Lukasa/repos","events_url":"https://api.github.com/users/Lukasa/events{/privacy}","received_events_url":"https://api.github.com/users/Lukasa/received_events","type":"User","site_admin":false},"created_at":"2015-02-12T14:31:37Z","updated_at":"2015-02-12T14:31:37Z","body":"This is a known error in twitter.com. Somewhat appropriately I filed this as a bug report [via Twitter](https://twitter.com/Lukasaoz/status/563771664576811008).\r\n\r\nThanks for the update @t2y! This will be a good resource for others, but for now I'll be closing this as it's not a hyper bug. =)"}}