Warning
This article was automatically translated by OpenAI (gpt-4o).It may be edited eventually, but please be aware that it may contain incorrect information at this time.
The curl (8.4.0) installed on my Mac does not yet support HTTP/3, so I will install a version of curl that supports HTTP/3.
The version of curl on my machine is as follows.
$ curl --version
curl 8.4.0 (x86_64-apple-darwin23.0) libcurl/8.4.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.58.0
Release-Date: 2023-10-11
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL threadsafe UnixSockets
Cloudflare has published a Formula, so I will use this.
The installation method is as follows.
brew remove -f curl
brew tap cloudflare/homebrew-cloudflare
brew install cloudflare/cloudflare/curl
Update the PATH.
echo 'export PATH="/opt/homebrew/opt/curl/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
The version of curl has been updated to one that supports HTTP/3.
$ curl --version
curl 8.7.1 (aarch64-apple-darwin23.4.0) libcurl/8.7.1 BoringSSL zlib/1.2.12 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libssh2/1.11.0 nghttp2/1.61.0 quiche/0.21.0 librtmp/2.3 OpenLDAP/2.6.8
Release-Date: 2024-03-27
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM SPNEGO SSL threadsafe UnixSockets zstd
Access www.google.com with the --http3-only option or the --http3 option (fallback if HTTP/3 is not supported).
$ curl -sI --http3-only https://www.google.com
HTTP/3 200
content-type: text/html; charset=ISO-8859-1
content-security-policy-report-only: object-src 'none';base-uri 'self';script-src 'nonce-y6mVW8uGnNhDZ-xNDKxEMg' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp
p3p: CP="This is not a P3P policy! See g.co/p3phelp for more info."
date: Mon, 27 May 2024 02:19:02 GMT
server: gws
x-xss-protection: 0
x-frame-options: SAMEORIGIN
expires: Mon, 27 May 2024 02:19:02 GMT
cache-control: private
set-cookie: 1P_JAR=2024-05-27-02; expires=Wed, 26-Jun-2024 02:19:02 GMT; path=/; domain=.google.com; Secure
set-cookie: AEC=AQTF6HyWW59syvHq_IU2A7RWxZ9yD31KrcD0PWLPXDfSoBiIY1asrSorjQ; expires=Sat, 23-Nov-2024 02:19:02 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=lax
set-cookie: NID=514=QWu6LZaPkS8mPRYU2gGVdfmFyQd4P979IyyhJ4uap_kEUb-DU2LVqgsgviT2wdbSwz_G2_q5dNGKqtEbjgron0hkGocAXoY2WrSUdqDgM7QWFvW5EpG1es9gPmjLxgozEZ_9LPpF3_WRq5BF3MJM8pQ1p09U-kjRgkvCPVVlfuc; expires=Tue, 26-Nov-2024 02:19:02 GMT; path=/; domain=.google.com; HttpOnly
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Returned with HTTP/3 200.