Skip to content

jay/webispy-h2curl

This branch is 9 commits behind webispy/h2curl:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

92408e3 · Aug 30, 2021

History

1 Commit
Aug 30, 2021
Aug 30, 2021
Aug 30, 2021
Aug 30, 2021
Aug 30, 2021
Aug 30, 2021
Aug 30, 2021
Aug 30, 2021
Aug 30, 2021

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 79.0%
  • JavaScript 14.5%
  • CMake 6.5%