Difficulty: beginner
Estimated Time: As long as you need

Objective

The objective of this scenario is to demonstrate how to install, set up and use an HTTP/2 server written under Node.JS.

The scenario's Node.JS project is programming to stream random numbers continuously of a single, unbroken TCP connection. Being able to do multipex streaming over a single TCP connection is powerful feature of the HTTP/2 protocol.

You'll implement the stream using the curl utility at the command line.

What you'll be doing

  • Install an HTTP/2 compatible version of curl in the Katacoda interactive learning environmenmt.
  • Get the server code from GitHub
  • Set up the HTTP/2 server
  • Stream data from the HTTP/2 server using curl

Executing command line instructions

This scenario is completely interactive. The instructions you'll be given will be executed directly in the terminal window that is embedded directly in the Katacoda interactive learning environment. In the steps to come, when you see a command line instruction with a black background and check mark at the end, like so:

Katacoda command line

just click on it and the command will execute in the interative terminal window.

Click the START SCENARIO button to continue.

Congratulations!

You've completed the scenario, Basic HTTP/2 - Implementing an HTTP/2 server

In this scenario you've:

  • Installed an HTTP/2 compatible version of curl in the Katacoda interactive learning environmenmt.
  • Got the server code from GitHub
  • Set up the HTTP/2 server
  • Streamed data from the HTTP/2 server using curl

Basic HTTP/2 - Implementing an HTTP/2 server

Step 1 of 4

Installing an HTTP/2 compatible version of curl

Objective

The objective of this lesson is to install a HTTP/2 compatible version of curl in the Katacoda interactive learning environment.

Steps

Run the following steps that install an HTTP/2 compliant version of curl.

Step 1: sudo apt update

Step 2: sudo apt-get -y install build-essential nghttp2 libnghttp2-dev libssl-dev

Step 3: wget https://curl.haxx.se/download/curl-7.63.0.tar.gz

Step 4: tar xzf curl-7.63.0.tar.gz

Step 5: cd curl-7.63.0

Step 6: ./configure --with-nghttp2 --prefix=/usr/local --with-ssl

Step 7: make && sudo make install

Step 8: sudo ldconfig

Step 9: Go back the scenario's $HOME directory:

cd ~/


Next: Get the server code from GitHub