Super fast, zero configuration command line HTTP Server written in Crystal.
crystal run src/fast-http-server.crOr build and run:
shards build --release
./bin/fast-http-serverOpen http://localhost:3000 - done. 🚀
- ⚡ Zero config - Run and go, defaults to port 3000
- 📁 Static file serving - Serves files from current directory or specified path
- 🔗 Index redirect - Automatically redirects
/blog/to/blog/index.html - 📂 Directory listing - Browse directories in browser (can be disabled)
- 🚀 25K req/sec - Fast enough for most use cases
| Problem | Solution |
|---|---|
| "I just need to serve static files quickly" | One command, no config |
| "Python http.server is slow" | Crystal native speed, 25K req/sec |
| "I don't want Node/npm for a static server" | Single binary, no dependencies |
| "I need directory listing" | Built-in, toggle on/off |
fast-http-server [port]| Argument | Default | Description |
|---|---|---|
port |
3000 | Port to listen on |
-d, --directory |
. |
Directory to serve |
-l, --listdir |
yes |
Enable/disable directory listing |
# Serve on port 5050
fast-http-server 5050
# Serve a specific directory
fast-http-server -d ./public
# Disable directory listing
fast-http-server -l no -d ./publicRequires Crystal 1.0+.
git clone https://github.com/sdogruyol/fast-http-server
cd fast-http-server
shards build --release
mv bin/fast-http-server /usr/local/bin/fast-http-serverAdd to your .bashrc, .zshrc, or config file:
alias fhs='fast-http-server'~25,000 requests/sec on modest hardware.
wrk -c 100 -d 20 -t 4 http://localhost:3000
Requests/sec: 25102.60
Transfer/sec: 22.81MB
Latency (avg): 3.98ms
Latency (p99): 5.86ms
How is this different from Python's http.server?
fast-http-server is ~50x faster, written in Crystal, and supports directory listing with index redirect out of the box.
Does it support HTTPS?
Not yet. For production, put it behind a reverse proxy like nginx or Caddy.
Can I use it in production?
It's designed for development and quick file sharing. For production, use nginx or Caddy.
If fast-http-server helps you, consider sponsoring. Every dollar helps me keep building open source tools full time.
MIT