Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP/2 support #628

Closed
Medvezo opened this issue May 29, 2019 · 2 comments
Closed

HTTP/2 support #628

Medvezo opened this issue May 29, 2019 · 2 comments

Comments

@Medvezo
Copy link

Medvezo commented May 29, 2019

How can I enable HTTP/2 on every request? Passing http2: true to options doesn't work

@Medvezo
Copy link
Author

Medvezo commented May 29, 2019

Passing { http_version: "2" } works, but still doesn't send HTTP/2 request. Here is the output of curl --version

curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Release-Date: 2018-01-24
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL 

@Medvezo
Copy link
Author

Medvezo commented May 29, 2019

After voracious digging I managed to make it work. For future lurkers:
response = Typhoeus.get("https://example.com", http_version: :httpv2_0, verbose: true)

To test it, you can also run response.http_version, which will return "2" (if you haven't noticed it from the cURL debug info).

You can find other available options here: https://github.com/typhoeus/ethon/blob/master/lib/ethon/curls/options.rb

@Medvezo Medvezo closed this as completed May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant