A lightweight HTTP server built with Python's built-in modules. Perfect for development, testing, and learning purposes.
- 🚀 Built-in Python modules - No external dependencies required
- 📁 File serving - Serves static files from the current directory
- 🌐 CORS enabled - Cross-origin requests allowed for development
- 📝 Enhanced logging - Better request logging with timestamps
- 🔍 File detection - Automatically detects HTML and web assets
- 📂 Directory listing - Browse files in the current directory
python simple_server.py- Main page: http://localhost:8000/index.html
- File browser: http://localhost:8000/
- Any HTML file: http://localhost:8000/yourfile.html
Press Ctrl+C in the terminal
- Port: 8000 (configurable in the code)
- Protocol: HTTP/1.1
- Handler: Custom SimpleHTTPRequestHandler
- CORS: Enabled for all origins (development only)
- File Detection: Automatically scans for HTML and web assets
SecurityLearnings/
├── simple_server.py # Main server script
├── index.html # Sample HTML page (external file)
├── requirements.txt # Dependencies (none required)
└── README.md # This file
Edit the PORT variable in simple_server.py:
PORT = 8080 # Change to your preferred portExtend the SimpleHTTPServer class to add custom routing logic.
Edit any HTML, CSS, or JavaScript files in your directory. The server will serve them as-is.
- CORS is enabled for all origins
- No authentication or rate limiting
- Serves files from the current directory
- Not suitable for production use
If you get "Address already in use" error:
- Stop other services using port 8000
- Change the port number in the code
- Use
lsof -i :8000to find what's using the port
Make sure you have write permissions in the current directory for creating sample files.
- Python 3.6 or higher
- No external packages required
- Works on Windows, macOS, and Linux
This is a simple learning project. Feel free to modify and use as needed.