Minimalistic HTTP web-server for file-sharing, single-page application hosting and many more. Intended for development use / as an utility, not for production use
staticserver
[--port={port | default to 80 }] \
[--root={root (default to working directory)}] \
[--mode={spa | upload | fs default}]
- HTTPS
%USERPROFILE%\Downloads\PortableGit\usr\bin\openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -subj '/CN=localhost' -keyout server.key -out server.crt
- pdf mode (requires https)
- a LAN version of dirkarnez/webcam-playground which the
.pdf
file is uploaded to the host computer
- a LAN version of dirkarnez/webcam-playground which the
- encoder mode
- proxy mode
- media streaming
- prompt to auto assign port if default 80 is used
- directory upload
-
<input type="file" id="ctrl" webkitdirectory directory multiple/>
-
- force no-caching in client-side
- File Server
- Streaming (Music, Videos, text files)
- Upload Server
- Directory-synchronization server
- Chatroom
- Clipboard Server
- Fix MIMEType, add customization support
application/vnd.android.package-archive
for.apk
application/wasm
for.wasm
text/css
for.css
- Auto-open default browser
- spa mode bugs
-
The mime-type in Windows registry may be modified by other software causing wrong
Content-Type
in response, see issue(s)- golang/go#32350
- How to fix:
regedit
-> go toComputer\HKEY_CLASSES_ROOT\.js
-> setContent Type
toapplication/javascript
- It should be platform-independent anyway
- How to fix:
- golang/go#32350
-
Some server-side files does not have their correct
Content-Type
in response (text/html; charset=utf-8
), found-
.woff
-
.ttf
-
- Common MIME types - HTTP | MDN
- Sample
mime.yaml
file (in case user-defined mime is needed, create one under the working directory)
.otf: font/otf
.woff: font/woff
.woff2: font/woff2
.ttf: font/ttf
.ico: image/vnd.microsoft.icon
.apk: application/vnd.android.package-archive
.wasm: application/wasm
.js: application/javascript
- GoogleChromeLabs/simplehttp2server: A simple HTTP/2 server for development
- kangc666/MyPHPServer: A easy PHP Server written in Golang
- http-server - npm
- svrxjs/svrx: Server-X: A pluggable frontend server built for efficient front-end development
- svenstaro/miniserve: 🌟 For when you really just want to serve some files over HTTP right now!
- HFS ~ HTTP File Server
- caddyserver/caddy: Fast, multi-platform web server with automatic HTTPS