python-hyper / hyper

HTTP/2 for Python.
http://hyper.rtfd.org/en/latest/
MIT License
1.05k stars 191 forks source link

First Try: timeout #349

Closed jlaskowski closed 7 years ago

jlaskowski commented 7 years ago

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.

KostyaEsmukov commented 7 years ago

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())
jlaskowski commented 7 years ago

thanks...change your docs, please

On 9/3/17 11:41 PM, Kostya Esmukov wrote:

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()) |

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Lukasa/hyper/issues/349#issuecomment-326859493, or mute the thread https://github.com/notifications/unsubscribe-auth/ABFf1EBnK4zJ2y3zASNqIKFsmPJxuckJks5se3F3gaJpZM4PLamH.