#local-server #server #https #server-http #serve-static #command-line-tool

devserver_lib

A zero configuration library for hosting a local folder via https. Refer to 'devserver' for the command line tool.

4 releases

0.4.2 Mar 25, 2023
0.4.1 Jan 2, 2022
0.4.0 May 7, 2021
0.1.7 Sep 14, 2020
0.1.0 Dec 30, 2019

#1438 in HTTP server

Download history 2684/week @ 2024-12-01 3434/week @ 2024-12-08 3598/week @ 2024-12-15 750/week @ 2024-12-22 824/week @ 2024-12-29 3493/week @ 2025-01-05 3289/week @ 2025-01-12 2764/week @ 2025-01-19 3226/week @ 2025-01-26 3656/week @ 2025-02-02 2944/week @ 2025-02-09 2918/week @ 2025-02-16 2066/week @ 2025-02-23 2957/week @ 2025-03-02 3136/week @ 2025-03-09 3434/week @ 2025-03-16

11,747 downloads per month
Used in 2 crates

Zlib license

43KB
792 lines

devserver_lib

devserver_lib does (nearly) the minimum necessary to serve a static folder over https://localhost:8080.

DO NOT USE DEVSERVER_LIB IN PRODUCTION

devserver_lib should only be used for locally hosting files on a trusted network.

devserver_lib does not properly handle the attacks robust servers must withstand on an open network.

usage

extern crate devserver_lib;

fn main() 
{
  devserver_lib::run(&"localhost", 8080, "", /*Auto-reload:*/ true ); // Runs forever serving the current folder on http://localhost:8080
}

dependencies

rust-native-tls

Dependencies only for the reload feature: notify sha-1 base64

Resources to learn from

https://doc.rust-lang.org/book/ch20-00-final-project-a-web-server.html

http://concisecoder.io/2019/05/11/creating-a-static-http-server-with-rust-part-1/

Dependencies

~0–9.5MB
~109K SLoC