Metadata-Version: 2.4
Name: pserve
Version: 0.1.1
Summary: A simple HTTP/HTTPS server package with self-signed certificates
Home-page: https://github.com/nextsaimon/pserve
Author: Saimon
Author-email: me@nextsaimon.com
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cryptography
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 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\Scripts`
  Add this path to **Environment Variables → Path**

- **Linux/macOS:**
  Usually `~/.local/bin`
  Add this line to your shell config (`.bashrc` / `.zshrc`):

  ```bash
  export PATH="$HOME/.local/bin:$PATH"
  ```

After updating PATH, you can run from anywhere:

```bash
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:

```bash
git clone https://github.com/nextsai/sServe.git
cd sServe
pip install .
```

---

## Usage

### HTTPS Server

Default port 5555:

```bash
phttps
```

Custom port (e.g., 3000):

```bash
phttps 3000
```

### HTTP Server

Default port 5555:

```bash
phttp
```

Custom port (e.g., 8080):

```bash
phttp 8080
```

### Using Python Module

You can also run using Python's `-m` flag:

```bash
python -m phttps 3000   # HTTPS server
python -m phttp 8080    # HTTP server
```

---
