fast-http-server

August 1, 2026 ยท View on GitHub

Super fast, zero configuration command line HTTP Server written in Crystal.

Stars CI Release Crystal License Built with Crystal


Quick Start

crystal run src/fast-http-server.cr

Or build and run:

shards build --release
./bin/fast-http-server

Open http://localhost:3000 - done. ๐Ÿš€


Features

  • โšก 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

Why fast-http-server?

ProblemSolution
"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

Usage

fast-http-server [port]
ArgumentDefaultDescription
port3000Port to listen on
-d, --directory.Directory to serve
-l, --listdiryesEnable/disable directory listing

Examples

# 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 ./public

Installation

Option 1: Build from source

Requires 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-server

Option 2: Quick alias

Add to your .bashrc, .zshrc, or config file:

alias fhs='fast-http-server'

Performance

~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

FAQ

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.


Sponsors

If fast-http-server helps you, consider sponsoring. Every dollar helps me keep building open source tools full time.

Sponsor


License

MIT