Giter Site home page Giter Site logo

h2curl's Introduction

HTTP/2 POST test using curl library

Test environment

  • Architecture: x86_64
  • OS: Ubuntu 20.04

Test scenario

client -> server: HTTP/2 GET /longPolling  (Stream-1)
server -> client: Header response
server -> client: Dummy data
server -> client: (Stream hold for 10 seconds)
...
after 7 seconds
...
client -> server: HTTP/2 POST /post  (Stream-3)
server -> client: Header response
server -> client: (Stream hold for 5 seconds)
client -> server: Send post data (100 bytes)
client -> server: Send post data (100 bytes)
...

Simple test server code (node.js, tested with v14.17.5 LTS version)

HTTP/2 POST test client code

Prepare

Clone this repository and update submodules. (nghttp2, curl)

$ git clone https://github.com/webispy/h2curl.git
$ cd h2curl
h2curl$ git submodule update --init

Curl library version

abnormal test case - c4e6968

cd externals/curl
curl$ git reset --hard
curl$ git clean -df
curl$ git checkout c4e6968

normal test case - 842f73d

cd externals/curl
curl$ git reset --hard
curl$ git clean -df
curl$ git checkout 842f73d

Run sample HTTP/2 server

In the server directory, there is a sample server program written in node.js for testing.

$ cd server
server$ npm install
server$ npm start

Build and run sample POST example

The test program used the http2-upload.c file provided in the libcurl example with some modifications.

Executing the commands below builds the nghttp2 library and curl library and then builds the example application.

$ mkdir build && cd build
build$ cmake ..
build$ make

And in order to access the data file to be transmitted when executing the example, you need to copy the dummy.dat file to the directory to be executed.

build$ cp ../dummy.dat .
build$ ./src/h2post

Test result

abnormal test case

normal test case

h2curl's People

Contributors

webispy avatar

Watchers

 avatar  avatar

Forkers

jay

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.