Skip to content

Instantly share code, notes, and snippets.

@xmlking
Created December 4, 2021 20:09
Show Gist options
  • 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
@sh-cho
Copy link

sh-cho commented Aug 12, 2024

FYI, /opt/homebrew can be replaced with $(brew --prefix)

@Centzilius
Copy link

You could also do

brew install cloudflare/homebrew-cloudflare/curl

@dalisoft
Copy link

Thank you. @Centzilius solution worked

@deansimcox
Copy link

Quick copy/paste install for intel

brew remove -f curl
brew install cloudflare/homebrew-cloudflare/curl
echo 'export PATH="/usr/local/opt/curl/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

@jialechan
Copy link

macos m2

brew remove -f curl
brew install cloudflare/homebrew-cloudflare/curl
echo 'export PATH="/opt/homebrew/opt/curl/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

@danktec
Copy link

danktec commented Jun 12, 2025

actually installed here. M3 Pro, MacOS 15.5

/opt/homebrew/Cellar/curl/HEAD-1cdac95/bin

@hsir
Copy link

hsir commented Jul 9, 2025

can it automatically update with further brew update?

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