Skip to content

Instantly share code, notes, and snippets.

@xmlking
Created December 4, 2021 20:09
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xmlking/cff9510dac9281d29390392cbbb033a8 to your computer and use it in GitHub Desktop.
Save xmlking/cff9510dac9281d29390392cbbb033a8 to your computer and use it in GitHub Desktop.
Installing curl with http3 on MacOS

Work-in-pogress

Ref: cloudflare/homebrew-cloudflare#21

 # 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
brew install --formula --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
@Erisa
Copy link

Erisa commented Dec 26, 2023

On ARM64 macOS the path is different:

echo 'export PATH="/opt/homebrew/opt/curl/bin:$PATH"' >> ~/.zshrc

@Shkeats
Copy link

Shkeats commented Mar 27, 2024

Thanks @xmlking and @Erisa!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment