A simple HTTP/HTTPS server package with self-signed certificates
Project description
sServe: HTTP & HTTPS Python Server
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.
Features
-
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.
Adding Python Scripts folder to 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
Installation
Clone the repository and install locally:
git clone https://github.com/nextsai/sServe.git
cd sServe
pip install .
Usage
HTTPS Server
Default port 5555:
phttps
Custom port (e.g., 3000):
phttps 3000
HTTP Server
Default port 5555:
phttp
Custom port (e.g., 8080):
phttp 8080
Using Python Module
You can also run using Python's -m flag:
python -m phttps 3000 # HTTPS server
python -m phttp 8080 # HTTP server
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pserve-0.1.1.tar.gz.
File metadata
- Download URL: pserve-0.1.1.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d874eacaa5baa41105b8aeb0e037e32fbbca6e50e0ef072bb3fa2483e3c7a59a
|
|
| MD5 |
379268b080fbb979dd3abea53600cab0
|
|
| BLAKE2b-256 |
7932a465a8054ae0bebcef24e7dcc4ac4477881153e352ecb10741de2373f00b
|
File details
Details for the file pserve-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pserve-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58bb70a88723b7b111ce36f5fb43472599296084d0f1e4954f3eb11ad0399230
|
|
| MD5 |
1e53d93c4e50e976017596c58bb886dc
|
|
| BLAKE2b-256 |
b8523fa2b5a126e2ea7c9abfeb90d5d2885f4c21f309af81d91bb6fbf90a834f
|