Skip to content

deweerdt/h2o-exercise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

Needed software

The observation track

With Chrome

Using chrome://net-internals#http2 . Note that you can use "Flush Sockets" in the upper right corner to force Chrome to re-establish an HTTP/2 connection.

  • Observe connection coalescing:
    • https://www.vox.com
    • Verify that they share the same IP:
      dig cdn.vox-cdn.com
      dig fonts.voxmedia.com
      
    • Check the SAN: openssl s_client -connect fonts.voxmedia.com:443 2>&1 | openssl x509 -text | grep -A1 'Subject Alternative Name'
  • Observer pushes
    • https://seekingalpha.com/
    • find HTTP2_SESSION_RECV_PUSH_PROMISE
    • observe how H2O replicated some of the headers for the request that originated the push

With Firefox

The low-level client track

Build h2get:

h2get embeds a Ruby interpreter, it can be used as following: ./h2get script.rb

Establishing a connection

GOAWAY frames

An endpoint that encounters a connection error SHOULD first send a GOAWAY frame (Section 6.8) with the stream identifier of the last stream that it successfully received from its peer

  • Send invalid values in the SETTINGS frame in order to obtain a response from the server (search for PROTOCOL_ERROR in the RFC)
  • Send an invalid stream id -- use send_headers

PING frames

Have a client sending send PING frames (https://www.google.com or https://www.fastly.com respond to PING)

HPACK

Implement decode_int https://tools.ietf.org/html/rfc7541#section-5.1

Checkout the no-decode-int branch, use ./test_decode_int to check the implementation.

The server track

H2O frame handling

H2O core frame handling function is lib/http2/connection.c::expect_default. This function dispatches the received frame depending on its type. Apply 0001-Output-priorities.patch in order to have priority information about the requests output to stderr.

Following the same model, instrument handle_window_update_frame in order to understand how browsers send WINDOW_UPDATE frames.

www/ has a directory that can be used as a root directory to serve different type of contents.

Using H2O as a library

This assumes that you've built and installed h2o. This repository comes with a small C server that uses libh2o that we will customize.

  • install and compile h2o:
    • cmake -DOPENSSL_ROOT_DIR=/usr/local/Cellar/[email protected]/1.1.0f/ .
    • make -j 4 && make install
  • Build the sample server in this directory:
    • make
  • Add a handler that sends a JS file Make that JS of variable size, denpending on an URL parameter, use h2o_req_t to find the path of the request .
  • Add a handler that sends a CSS file Make this of variable size
  • Add a handler that sends an HTML file Reference the js and css, multiple times
  • Add a 'Link: preload' header

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published