github.com/Nitrajsinh-Solanki/simple-file-server
07 / 11
⚡ Bounty Claimed
Rust Simple File Server
This project was built for the StackUp Rust Bounty Challenge — the first submission to complete all objectives. The server binds a TcpListener to port 7878 and handles each connection with a custom HTTP parser that reads raw bytes, extracts the method and path, locates the file on disk, detects its MIME type via mime_guess, and writes a full HTTP response back over the stream — all without any web framework dependency.
Engineering Case Study
- Challenge
- A small file server should serve files over HTTP without relying on a web framework, making the underlying TCP and HTTP handling explicit.
- Approach
- Build directly on Rust’s TcpListener, raw byte streams, custom request/response handling, MIME detection and filesystem traversal utilities.
- Contribution
- Implemented request parsing, method and path handling, file lookup, MIME-type headers, status responses, directory traversal and URL encoding/decoding.
- Outcome
- Completed the StackUp Rust Bounty Challenge objectives first, without using a web framework.
Key Features
- Raw TCP listener — no web framework whatsoever
- Custom HTTP request parser — method, path, headers from raw bytes
- Custom HTTP response builder with correct status codes
- MIME type detection via mime_guess for proper Content-Type headers
- Recursive directory traversal using walkdir
- URL encoding/decoding via url-escape
- First submission to complete all StackUp Rust Bounty objectives
Tech Stack
RustCargowalkdirinferurl-escapemime_guessTCP/HTTPSystems Programming