Skip to content

vitaly-castLabs/httpsrv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

httpsrv

A simple HTTP(S) server which sucks much less than python3 -m http.server (96k vs 3.5k requests per second with wrk -t4 -c200 -d10s <addr>). Another selling point is an unbearably awesome name.

Based on my fork of tiny but mighty cpp-httplib.

How to build

Install prerequisites, Ubuntu/Debian:

sudo apt install -y git g++ cmake libssl-dev libbrotli-dev

macOS (start with xcode-select --install or brew install gcc if you don't have a C++ compiler installed):

brew install git cmake openssl brotli

Windows (add gcc to the scoop install list if you don't have a C++ compiler installed):

scoop install git cmake openssl brotli

Clone and build:

git clone https://github.com/vitaly-castLabs/httpsrv.git && \
cd httpsrv && \
cmake . && \
cmake --build . --config Release

How to run

cd into the folder you want to serve and run httpsrv [port] [cert] [priv-key] (self-signed certificate and privare key are provided). Some examples:

httpsrv                        - serve http on port 8080
httpsrv 80                     - serve http on port 80 (might require sudo)
httpsrv 8443 cert.pem key.pem  - serve https on port 8443
httpsrv 8000 --sab             - serve http on port 8000 with SharedArrayBuffer headers

About

Simple HTTP(S) server written in C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors