#tls #wsgi

app rust-http-server

A simple and fast HTTP server written in rust

1 unstable release

Uses old Rust 2015

0.0.1 Mar 1, 2018

#290 in #tls

BSD-2-Clause

58KB
1.5K SLoC

Rust-HTTP-Server

Build Status

Rust-HTTP-Server is a small multi-threaded webserver that supports TLS and WSGI. Rust-HTTP-Server's goal is to be an easy to use, fast and lightweight http server.

Table of Contents:

Installation:

Currently the only way to install rust-http-server is to download the project and build with cargo. crates.io support is coming soon!

Usage:

With Cargo:

  • cargo run to start the server
  • cargo run -- -h for help
  • cargo test to run the tests (Note: Openssl must be installed on your system otherwise the TLS test will fail.)

rust-http-server will look for config.json in the current working directory. Config options include:

  • host
  • port
  • app - a string <module>:<callable>. The server will search for a file with the same name as the module to run.
  • static_folder - A path to a folder. This will register everything within the folder.
  • https_cert
  • cert_password
  • threads

CLI usage:


            [DIRECTORY]            'Serves the contents of the directory'
            -h, --host=[HOST]       'Sets the host address'
            -p, --port=[PORT]       'Sets the port'
            -a, --app=[APP]         '<module>:<callable> The server application'
            -cert=[CERT],           'Path to pkcs12 certificate'
            -pwd=[PWD],             'Password for the pkcs12'
            -t, --threads=[THREADS] 'Sets the number of threads to use'
            -v...                   'Sets verbosity'

TODO:

  • More documentation
  • HTTP passthrough
  • Benchmarks

Dependencies

~8–18MB
~243K SLoC