This project is a simple HTTP file server written in Rust. It serves files and directories from the project root over HTTP, allowing you to browse and download files using your web browser.
- Serves static files (HTML, images, PDFs, etc.) from the project directory
- Directory listing: browse folders and files via your browser
- Handles binary and text files
- Simple, single-threaded TCP server
- The server listens on
localhost:5500by default. - When you visit
http://localhost:5500/in your browser, you see a list of files and directories in the project root. - Clicking a file downloads or displays it (depending on your browser and file type).
- Clicking a directory navigates into it, showing its contents.
Make sure you have Rust installed.
cargo runGo to http://localhost:5500/ in your web browser.
You should see a directory listing of your project. You can click on files to download/view them, or click into folders to browse further.
src/main.rs: Main server logic (socket, request handling)src/http/request.rs: HTTP request parsingsrc/http/response.rs: HTTP response and directory listing logicindex.html: Example static file
- The server only listens on
localhost(127.0.0.1) for security. - Large files are sent as binary data.
- The server is for local development and testing, not for production use.
MIT