Code Monkey home page Code Monkey logo

h2spec's Introduction

h2spec

h2spec is a conformance testing tool for HTTP/2 implementation.
This tool is compliant with RFC 7540 (HTTP/2) and RFC 7541 (HPACK).

Install

Go to the releases page, find the version you want, and download the zip file or tarball file. The docker image is also available in Docker Hub.

Your server

Your server should respond on GET / or POST / requests with status 200 response with non-empty data.

Usage

Conformance testing tool for HTTP/2 implementation.

Usage:
  h2spec [spec...] [flags]

Flags:
  -c, --ciphers string          List of colon-separated TLS cipher names
      --dryrun                  Display only the title of test cases
      --help                    Display this help and exit
  -h, --host string             Target host (default "127.0.0.1")
  -k, --insecure                Don't verify server's certificate
  -j, --junit-report string     Path for JUnit test report
      --max-header-length int   Maximum length of HTTP header (default 4000)
  -P, --path string             Target path (default "/")
  -p, --port int                Target port
  -S, --strict                  Run all test cases including strict test cases
  -o, --timeout int             Time seconds to test timeout (default 2)
  -t, --tls                     Connect over TLS
  -v, --verbose                 Output verbose log
      --version                 Display version information and exit

Running a specific test case

You can choose a test case to run by specifying the Spec ID as the command argument. For example, if you want to run test cases for HTTP/2, run h2spec as following:

$ h2spec http2

If you add a section number after the Spec ID, test cases related to a specific section will be run. For example, if you want to run test cases related to 6.3 of HTTP/2, run h2spec as following:

$ h2spec http2/6.3

If you add a test number after the section number, you can run the specific test case individually. For example, to run only the first test case related to 6.3 of HTTP/2 6.3, run h2spec as following:

$ h2spec http2/6.3/1

The Spec ID can be specified multiple times.

$ h2spec http2/6.3 generic

Currently supported Spec IDs are as follows. generic is the original spec of h2spec, includes generic test cases for HTTP/2 servers.

Spec ID Description
http2 Test cases for RFC 7540 (HTTP/2)
hpack Test cases for RFC 7541 (HPACK)
generic Generic test cases for HTTP/2 servers

Dryrun Mode

To display the list of test cases to be run, use Dryrun Mode as follows:

$ h2spec --dryrun

Strict Mode

When Strict Mode is enabled, h2spec will run the test cases related to the contents requested with the SHOULD notation in each specification. It is useful for more rigorous verification of HTTP/2 implementation.

$ h2spec --strict

Screenshot

Sceenshot

Build

To build from source, you need to install Go and export GO111MODULE=on first.

To build:

$ make build

To test:

$ make test

License

h2spec is made available under MIT license.

h2spec's People

Contributors

summerwind avatar chhsiao90 avatar tatsuhiro-t avatar jstourac avatar bryce-anderson avatar shane-kearns avatar lukasa avatar kazuho avatar karm avatar essen avatar masaori335 avatar madgnome avatar detailyang avatar stepancheg avatar maskit avatar lorban avatar jackloughran avatar vankoven avatar i110 avatar deweerdt avatar anmonteiro avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.