Installing curl with http3 on MacOS
Justin
Posted on October 8, 2020
When you are all said and done with this tutorial, you'll be able to double check http3 support via the curl command like this:
curl --http3 https://cloudflare-quic.com -I
HTTP/3 200
date: Fri, 24 Jul 2020 08:10:24 GMT
content-type: text/html
content-length: 106072
set-cookie: __cfduid=d8647a359d68a89c060bde4f373e18cc61595578224; expires=Sun, 23-Aug-20 08:10:24 GMT; path=/; domain=.cloudflare-quic.com; HttpOnly; SameSite=Lax; Secure
cf-request-id: 042178a64b0000188b7b1d9200000001
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
cf-ray: 5b7c2a1d4eb5188b-MAN
alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400
Unfortunately, this currently involves building curl from source, luckily for us, cloudflare makes this even easier.
- Note: You must have https://brew.sh/ installed already
# Clean up any old version of curl you may have already tried to install
brew remove -f curl
# Download the curl ruby install script provided by cloudflare
wget https://raw.githubusercontent.com/cloudflare/homebrew-cloudflare/master/curl.rb
# Install curl via that script from the latest git repos
brew install --HEAD -s curl.rb
# Tell your cli to use the curl version just installed (if you're using zsh, othwerise you might need `~/.bashrc`)
echo 'export PATH="/usr/local/opt/curl/bin:$PATH"' >> ~/.zshrc
# Reload your config
source ~/.zshrc
# Double check it's using the right curl
which curl # Should output "/usr/local/opt/curl/bin/curl"
# Double check http3
$ curl --version | grep HTTP3
Features: alt-svc AsynchDNS brotli HTTP2 HTTP3 IDN IPv6 Largefile libz MultiSSL NTLM NTLM_WB SSL UnixSockets zstd
# Try curl on any HTTP/3 enabled sites.
curl --http3 https://blog.cloudflare.com -I
Have fun upgrading all the servers!
💖 💪 🙅 🚩
Justin
Posted on October 8, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
githubcopilot AI Innovations at Microsoft Ignite 2024 What You Need to Know (Part 2)
November 29, 2024