A lightweight Python server for HTTP and HTTPS, designed for developers to quickly serve files locally or on a network. Works seamlessly on Windows, Linux, and macOS. Auto-generates self-signed certificates for HTTPS and supports clean shutdown with Ctrl+C.
-
HTTPS Server with auto-generated self-signed certificates
-
HTTP Server for plain HTTP connections
-
Displays both Local and Network IP addresses
-
Works on Windows, Linux, and macOS
-
Clean Ctrl+C shutdown
-
Easy CLI commands:
phttps [port]– start HTTPS server (default port 5555)phttp [port]– start HTTP server (default port 5555)
⚡ Tip: If the commands are not recognized, ensure your Python Scripts folder is added to your system PATH.
-
Windows: Usually
C:\Users\<YourUsername>\AppData\Local\Programs\Python\Python3X\ScriptsAdd this path to Environment Variables → Path -
Linux/macOS: Usually
~/.local/binAdd this line to your shell config (.bashrc/.zshrc):export PATH="$HOME/.local/bin:$PATH"
After updating PATH, you can run from anywhere:
phttps 3000 # HTTPS server on port 3000
phttp 8080 # HTTP server on port 8080- Compatible with Python 3.12+
- Uses cryptography library for certificate generation
Clone the repository and install locally:
git clone https://github.com/nextsai/sServe.git
cd sServe
pip install .Default port 5555:
phttpsCustom port (e.g., 3000):
phttps 3000Default port 5555:
phttpCustom port (e.g., 8080):
phttp 8080You can also run using Python's -m flag:
python -m phttps 3000 # HTTPS server
python -m phttp 8080 # HTTP server