Skip to content

Instantly share code, notes, and snippets.

@sinwoobang
Last active November 21, 2023 20:24
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sinwoobang/c83af540a2df8b149a59007e5f5814ec to your computer and use it in GitHub Desktop.
Save sinwoobang/c83af540a2df8b149a59007e5f5814ec to your computer and use it in GitHub Desktop.
Install curl supporting HTTP/3 on Apple Silicon
# Referred to https://dev.to/gjrdiesel/installing-curl-with-http3-on-macos-2di2
# 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
curl -O https://gist.githubusercontent.com/sinwoobang/bfc7cc8d4d38157bde064fc2ccb60c64/raw/bf55b7c6af9ed06d2cd909ea167a69948a800e7d/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="/opt/homebrew/opt/curl/bin:$PATH"' >> ~/.zshrc
# Reload your config
source ~/.zshrc
# Double check it's using the right curl
which curl # Should output "/opt/homebrew/opt/curl/bin/curl"
# Double check http3
curl --version | grep HTTP3
# Try curl on any HTTP/3 enabled sites.
curl --http3 https://blog.cloudflare.com -I
@korotkevics
Copy link

Nice! You may want to remove the white space in the line no 13 (PATH=" /opt...).

@sinwoobang
Copy link
Author

Nice! You may want to remove the white space in the line no 13 (PATH=" /opt...).

Thanks! Your suggestion has been reflected.

@Agnibho-8
Copy link

I am facing the following error

Error: Failed to load cask: curl.rb
Cask 'curl' is unreadable: wrong constant name #Class:0x000000013819e630
Warning: Treating curl.rb as a formula.

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