Skip to content

Fun little webapp to play with Rust. A static file server and REST API in 8 MB of memory.

License

Notifications You must be signed in to change notification settings

aaronriekenberg/rust-hyper-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-hyper-server

What is this?

Static file server and REST API in rust using hyper v1.1.0 and tokio

Features:

  • toml configuration files
  • any number HTTP 1.x or HTTP 2 servers using hyper, each listening on 1 configured TCP or UNIX socket
  • structured logging with spans for incoming connections and requests
  • static file server using hyper-staticfile
    • precompressed static files (bz and/or gz)
  • configurable rules list using regular expressions for cache control response headers on static files
  • server connection tracking
    • timeouts with graceful shutdown
    • track connection age, requests per connection, configurable connection limit
    • historical connection metrics
  • generic handlers::RequestHandler async trait to handle requests
    • asynchronously run configured shell commands and return response as json
    • static file handler
    • connection info
    • request info
    • version info

Github Actions

When the release build is too slow on your Raspberry Pi: Use github actions to cross-compile.

Memory Usage

This app runs in about 8 megabytes of resident memory (RSS) on a 64-bit Raspberry Pi.

$ ps -eo pid,pmem,rss,vsz,comm --sort -rss

    PID %MEM   RSS    VSZ COMMAND         
  10791  0.8  7744 890832 rust-hyper-serv

About

Fun little webapp to play with Rust. A static file server and REST API in 8 MB of memory.

Resources

License

Stars

Watchers

Forks

Packages

No packages published