Installing H2 supported curl on Mac

Installing H2 supported curl on Mac

Originally posted at: https://community.akamai.com/community/web-performance/blog/2015/08/25/installing-h2-supported-curl-on-mac?sr=stream

Yesterday, we had a call at Akamai where an Engineering manager demonstrated the mechanism to install a curl that can support H2. I wanted to share this information since it may be of use to a broader set of audience. Note that this will work only for MAC. I am not aware of a way to make this work on Windows. At some point, I'll try with Linux and update or create a new post.

I am skipping the technical explanation on the why and how. This is a simple blog on just getting curl installed and using it. 

Step 1: Install Homebrew

Homebrew is the package manager for Mac. If it is not installed, just paste this line in terminal.

Source: Homebrew — The missing package manager for OS X

Step2: Install curl with dependencies

You will now need to install curl with the dependencies of nghttp and openssl.

Sources:

All the homebrew installed files are located at /usr/local/. In my case, the path for curl was: /usr/local/Cellar/curl/7.44.0/bin/curl.

Step 3: Testing curl with H2

Test by running this command against a H2 supported website. For example, I am testing against the Akamai H2 demo website:

Look at the output to confirm that you have indeed connected over H2. Here's the response lines I got from my test:

Step 4(a): Adding an alias for curl

If you'd like a short-cut for the new curl, just add an entry into your bash profile configuration. Here's how you can do it. I added the short-cut as h2curl.

Add this line to the file and save it.

Just restart your terminal. Now you can use the command "h2curl" whenever you need to use the H2 supported curl command. Note that due to the flags, the output will be ignored. If you need the output, then don't use the flag "-o /dev/null".

Step 4(b): Make new curl permanent

If you'd like to replace the default curl command with the new version, then run this command. Once you do this, you can always use the H2 supported curl and won't have to remember the alias or the path for the homebrew installed version of the curl command.

Hope this helps you on your way to test H2!

To view or add a comment, sign in

Insights from the community

Others also viewed

Explore topics