A simple static file http server
- Supports multiple paths mapping
- Supports angular router
- Supports custom index files
- Supports TLS (HTTPS)
- Supports basic authorize
- Supports compress
- Supports log file and colorful output
- Supports upload files
Current file path mapping to web root, default port is 8080.
./simplehttpserverBrowse http://localhost:8080
The dist path mapping to web root, port to 4200, index file is index.html and supports fallback to index.html
./simplehttpserver -addr :4200 -path dist -indexnames index.html -fallback index.htmlFirst, you can use mkcert to create the cert-files for develop.
mkcert -install
mkcert -cert-file ssl-cert.pem -key-file ssl-cert.key localhost 127.0.0.1 ::1Then run command
./simplehttpserver -addrtls :8081 -certfile ssl-cert.pem -keyfile ssl-cert.key -username admin -password admin -logfile 1.logBrowse https://localhost:8081
Make a config file
./simplehttpserver -makeconfig config.yaml
Edit config.yaml
You can add multiple paths in the config file.
Line starts with
#is a comment line.addr: 0.0.0.0:8080#addrtls: 0.0.0.0:8081#certfile: ./ssl-cert.pem#keyfile: ./ssl-cert.key#username: admin#password: admincompress: falsepaths: #/c: "C:\\"#/d: "D:\\"indexnames: - index.html - index.htmverbose: trueenablecolor: trueenableupload: true## maxrequestbodysize 0 to default sizemaxrequestbodysize: 9223372036854775807## timeout 0s is no limitreadtimeout: 0swritetimeout: 0slogfile: ./simplehttpserver.log#fallback: ./index.html#HTTP_PROXY:#HTTPS_PROXY:#NO_PROXY: ::1,127.0.0.1,localhost
Run with the config file
./simplehttpserver -config config.yaml
./simplehttpserver -helpbash ./build.shPowered by