python-hyper / hyper

HTTP/2 for Python.

Home Page:http://hyper.rtfd.org/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

First Try: timeout

jlaskowski opened this issue · comments

On Raspberry Pi 2, using Raspbian and Python 3.5.3, I installed hyper and tried to run your simple example which failed on the conn.request('GET','/get'):

from hyper import HTTPConnection

conn = HTTPConnection('http2bin.org:443')
conn.request('GET', '/get')
resp = conn.get_response()

print(resp.read())

Error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/.local/lib/python3.5/site-packages/hyper/common/connection.py", line 103, in request
    method=method, url=url, body=body, headers=headers
  File "/home/pi/.local/lib/python3.5/site-packages/hyper/http11/connection.py", line 169, in request
    self.connect()
  File "/home/pi/.local/lib/python3.5/site-packages/hyper/http11/connection.py", line 119, in connect
    sock = socket.create_connection((host, port), 5)
  File "/usr/lib/python3.5/socket.py", line 712, in create_connection
    raise err
  File "/usr/lib/python3.5/socket.py", line 703, in create_connection
    sock.connect(sa)
socket.timeout: timed out

I can't ping http2bin.org, but the host does resolve to an IP address.

http2bin.org is down for a long time now. Try with another one, like google.com

from hyper import HTTPConnection

conn = HTTPConnection('google.com:443', secure=True)
conn.request('GET', '/')
resp = conn.get_response()

print(resp.read())