Metadata-Version: 2.4
Name: paprika-proxy
Version: 1.0.0
Summary: Paprika - TLS/Header Spoofing Client & Proxy for Privacy and Scraping.
Author-email: nulsie <dontmailme@mail.com>
Description-Content-Type: text/markdown
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
License-File: LICENSE
Requires-Dist: curl_cffi>=0.7.0
Requires-Dist: proxy.py>=2.4.0

# Paprika
**version:** 1.0.0

Paprika is a specialized, programmatic local Man-in-the-Middle (MITM) proxy engineered to prevent client-side profiling, tracking, and anti-bot fingerprinting. By synchronizing Layer 4 (TCP/TLS) handshakes, Layer 7 (HTTP/2) settings framing, and Client Runtime (JavaScript V8/Gecko/WebKit Engine) configurations, Paprika mitigates advanced device-fingerprinting vectors used by modern anti-bot systems (e.g., Akamai, Cloudflare, PerimeterX).

Unlike standard forward proxies that merely modify the `User-Agent` string, Paprika intercepts, reconstructs, and patches incoming traffic bi-directionally to ensure absolute cryptographic and semantic cohesion.

---

## Deployment & Installation Architecture

Paprika is available in both GitHub and Codeberg and as a pip package.

### System Prerequisites

Before initializing Paprika, your host environment must have **OpenSSL** installed and accessible via the system `PATH`. Paprika’s automated zero-dependency certificate manager shells out to the OpenSSL binary to generate the 2048-bit Root CA and self-signed certificates for local HTTPS MITM decryption.

* **Windows:** `winget install OpenSSL.OpenSSL` (or via Git for Windows)
* **macOS:** `brew install openssl`
* **Linux:** `sudo apt install openssl`

### Installation via pip

For production or standard daemonized usage, install the pre-compiled package directly via pip:

```bash
pip install paprika-proxy

```

### Installation

**Via GitHub:**

```bash
git clone https://github.com/yourusername/paprika.git
cd paprika
pip install -r requirements.txt

```

**Via Codeberg:**

```bash
git clone https://codeberg.org/yourusername/paprika.git
cd paprika
pip install -r requirements.txt

```

*(Dependencies primarily include `curl_cffi` for Layer-4 impersonation and `proxy.py` for the localized routing server).*

---

## Usage

Paprika operates under two distinct execution topologies: **Fetch Mode** (a single-shot, headless request execution) and **Proxy Mode** (a persistent, multi-threaded MITM interceptor).

If executed without arguments, Paprika drops into an interactive REPL (Read-Eval-Print Loop) shell (`paprika-cli>`) for session-persistent command execution.

### 1. Fetch Mode (Single-Shot Emulation)

Fetch mode is designed for CI/CD pipelines, quick endpoint validation, or localized scraping where spinning up a full proxy daemon is unnecessary. It routes a single request through the `curl_cffi` engine and prints the raw response.

**Syntax:**

```bash
paprika --mode fetch --url <TARGET_URL> [--method <METHOD>] [--browser <PROFILE>]

```

**Example:** Fetch a highly protected JSON endpoint while strictly impersonating Firefox 135 on Windows:

```bash
paprika --mode fetch -u "https://api.protected-site.com/v1/data" -m GET --browser firefox135

```

### 2. Proxy Mode (MITM Intercept Daemon)

Proxy mode binds a local listener that intercepts all outgoing browser or script traffic. It dynamically rewrites Layer 7 headers, injects the JS prototype hooks into HTML responses, and seamlessly handles TLS decryption/re-encryption.

*Note: Upon boot, Paprika will automatically attempt to rewrite your host OS proxy settings (Windows Registry, macOS `networksetup`, or Linux `gsettings`) to route traffic through itself, restoring them upon a graceful exit.*

**Syntax:**

```bash
paprika --mode proxy [--port <PORT>] [--browser <PROFILE>] [--ca-key-file <PATH> ...]

```

**Example:** Spin up the localized MITM proxy on port `8899`, enforcing the Apple Silicon Safari 18.4 fingerprint constraint matrix:

```bash
paprika --mode proxy --port 8899 --browser safari184

```

### Command Line Arguments
| Argument | Context | Description | Default |
| --- | --- | --- | --- |
| `--mode` | Global | Execution topology: `fetch` or `proxy`. | `fetch` |
| `-u`, `--url` | Fetch | The fully qualified target URI. | *None* |
| `-m`, `--method` | Fetch | The HTTP verb (e.g., `GET`, `POST`, `OPTIONS`). | `GET` |
| `--browser` | Global | The configuration profile matrix to map against (`chrome124`, `firefox135`, `safari184`). | `chrome124` |
| `--port` | Proxy | The local loopback port to bind the MITM listener to. | `8899` |
| `--ca-key-file` | Proxy | Explicit path to a custom Root CA Private Key. | *Auto-Generated* |
| `--ca-cert-file` | Proxy | Explicit path to a custom Root CA Public Certificate. | *Auto-Generated* |

-----

**Author**: nulsie
**License**: GNU GPL v3

