Giter Club home page Giter Club logo

h123's Introduction

๐Ÿš€ H123

An experimental HTTP server in Rust that supports HTTP/1.1, HTTP/2, and HTTP/3 over QUIC.

Warning This is an experimental project and not intended for production uses.

๐Ÿ“ฆ Getting started

๐Ÿณ Using Docker (recommended)

docker run \
    -p 127.0.0.1:443:443/tcp \
    -p 127.0.0.1:443:443/udp \
    -v $(pwd)/htdocs:/htdocs \
    ghcr.io/siketyan/h123:latest

Easy!

๐Ÿ— Classic style

  1. Clone this repository.
  2. Prepare your TLS server certificate, or use the default self-signed one.
  3. Run the server with the command:
    cargo run -- -d ./htdocs -b 127.0.0.1:8443 --cert-chain-pem ./cert.pem --private-key-pem ./privkey.pem
  4. Boom! Your server is running.

๐Ÿ”Œ API

This crate also exposes a Server API to serve your service easily in HTTP/1.1, HTTP/2, and HTTP/3. To use the API, implement Service<Request<Bytes>, Response = Response<Bytes>> and call Server::new.

pub struct Server<S, E> {
    // ...
}

impl<S, E> Server<S, E> {
    pub fn new<A>(config: &ServerConfig, bind_to: A, service: Arc<S>) -> Self
    where
        A: Into<SocketAddr> + Copy;
}

๐Ÿ”ฌ Internals

This server implementation is made from these protocol implementations:

๐Ÿ“„ Licence

This repository is licenced under the Apache 2.0 Licence. For details, see LICENCE.md.

Copyright 2022 Naoki Ikeguchi <[email protected]>

h123's People

Contributors

dependabot[bot] avatar siketyan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.