Crates.io | scratch-server |
lib.rs | scratch-server |
version | 0.7.0 |
source | src |
created_at | 2024-05-25 12:56:53.277705 |
updated_at | 2024-09-14 12:34:00.933621 |
description | Simple HTTP Server |
homepage | https://github.com/radek00/http-server |
repository | https://github.com/radek00/http-server |
max_upload_size | |
id | 1251953 |
size | 85,189 |
Simple http server writen from scratch in Rust. Implemented api endpoints allow for navigating file system directories, uploading and downloading files.
Simlpe HTTP Server with TLS/SSL support. Implemented api endpoints allow for navigating file system directories, uploading and downloading files.
Usage: http-server [OPTIONS]
Options:
-p, --port <port> Sets the port number [default: 7878]
-t, --threads <threads> Sets the number of threads [default: 12]
-c, --cert <cert> TLS/SSL certificate
--certpass <certpass> TLS/SSL certificate password
-s, --silent Disable logging
--cors Enable CORS with Access-Control-Allow-Origin header set to *
--ip <ip> Ip address to bind to [default: 0.0.0.0]
-a, --auth <auth> Enable HTTP Basic Auth. Pass username:password as argument
--compression Enable gzip response compression
--index <index> Sets the path to custom index html file to serve
-h, --help Print help
-V, --version Print version
To use the cert option you have to:
openssl req -x509 -newkey rsa:4096 -keyout myKey.pem -out cert.pem -days 365
.openssl pkcs12 -export -out keyStore.p12 -inkey myKey.pem -in cert.pem
http-server -c ./keyStore.p12 --certpass yourPassword
. Certpass option can be left blank if no password was set.