Code Monkey home page Code Monkey logo

hyperflow's Introduction

HyperFlow

A basic implementation of HTTP2 in rust. This implementation receives http2 requests and provides them to a handler function in http 1.1 semantics. Response returned by the handler in http 1.1 semantics is then converted to http2 and sent.

This implementation has been tested with a basic GET and POST request via h2load.

❯ h2load http://localhost:8080 -d Cargo.toml -v
starting benchmark...
spawning thread #0: 1 total client(s). 1 total requests
Application protocol: h2c
[stream_id=1] :status: 200
[stream_id=1] content-length: 18
progress: 100% done

finished in 2.31ms, 432.53 req/s, 21.54KB/s
requests: 1 total, 1 started, 1 done, 1 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 1 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 51B (51) total, 6B (6) headers (space savings 76.92%), 18B (18) data
                     min         max         mean         sd        +/- sd
time for request:     1.87ms      1.87ms      1.87ms         0us   100.00%
time for connect:      308us       308us       308us         0us   100.00%
time to 1st byte:     2.21ms      2.21ms      2.21ms         0us   100.00%
req/s           :     446.74      446.74      446.74        0.00   100.00%

See the h2load succesfully received response from our rust impl of h2.

Application protocol: h2c
[stream_id=1] :status: 200
[stream_id=1] content-length: 18
progress: 100% done

finished in 2.31ms, 432.53 req/s, 21.54KB/s
requests: 1 total, 1 started, 1 done, 1 succeeded, 0 failed, 0 errored, 0 timeout

This implementation is NOT http2 compliant, however it can be extended to do so. I however doubt I'll continue this project as this project was mostly for learning about http2 by reading the rfc and practicing some rust.

Development

$ cargo run # to run the server
$ h2load http://localhost:8080 -v# to make http2 req
$ sudo tshark -i any -f "tcp port 8080" -Y "http2" -V # to monitor http2 requests
$ ~/Downloads/h2spec -p 8080 http2 # for checking compliance, you might have it somewhere else.

hyperflow's People

Contributors

prince776 avatar

Stargazers

Jayesh Parmar avatar Vardaan Aggarwal 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.