curl不支持mac上的http2

Mar*_*ine 14 homebrew curl http2

我有最新版本的curl,仍然没有看到http2显示为一个功能.我已经按照相关问题的步骤,但仍然运气不好.

$ /usr/local/Cellar/curl/7.43.0/bin/curl -V
curl 7.43.0 (x86_64-apple-darwin14.3.0) libcurl/7.43.0 SecureTransport zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

Jer*_*ley 28

brew info curl 列出启用该功能所需的标志.

brew reinstall curl --with-openssl --with-nghttp2 将更新您的安装.


Jef*_*rdy 15

Homebrew小组最近删除了该curl公式的所有选项,但该curl-openssl公式已启用HTTP / 2。

brew install curl-openssl
Run Code Online (Sandbox Code Playgroud)


Sim*_*tti 10

默认情况下,curl不编译nghttp2.如本文所述,您需要重新编译它,传递--with-nghttp2标记并链接它(以替换curlMac OS X附带的原始文件).

# install cURL with nghttp2 support
$  brew install curl --with-nghttp2

# link the formula to replace the system cURL
$  brew link curl --force

# now reload the shell
Run Code Online (Sandbox Code Playgroud)