# txtisalie1/httplistener architecture

> Architecture diagram of the GitHub repository txtisalie1/httplistener, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/txtisalie1/httplistener
- Repository: https://github.com/txtisalie1/httplistener

## Overview

This is a small educational HTTP packet sniffer. Scapy captures TCP port 80 traffic and dispatches packets to a callback, which extracts HTTP request host and path and, when present, decodes raw payload data for display. The only runtime implementation is in `http.py`; no separate storage or processing layers are evident.

Main entry points: [`http.py`](https://github.com/txtisalie1/httplistener/blob/main/http.py) (Request Analyzer)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_scapy["Scapy Sniffer"]
node_analyzer["Request Analyzer<br/>[http.py]"]
node_body["Body Decoder<br/>[http.py]"]
node_traffic(("HTTP Traffic"))
node_console["Console Output"]

node_traffic -->|"provides packets"| node_scapy
node_scapy -->|"dispatches packets"| node_analyzer
node_analyzer -->|"decodes raw payload"| node_body
node_analyzer -->|"prints request"| node_console
node_body -->|"prints body"| node_console

click node_analyzer "https://github.com/txtisalie1/httplistener/blob/main/http.py"
click node_body "https://github.com/txtisalie1/httplistener/blob/main/http.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_scapy,node_traffic,node_console toneIndigo
class node_analyzer toneMint
class node_body toneTeal
```

## Components

### Other components

- **Scapy Sniffer**
- [Request Analyzer](https://github.com/txtisalie1/httplistener/blob/main/http.py): `http.py`
- [Body Decoder](https://github.com/txtisalie1/httplistener/blob/main/http.py): `http.py`
- **HTTP Traffic**
- **Console Output**

## Connections

- HTTP Traffic → Scapy Sniffer: provides packets
- Scapy Sniffer → Request Analyzer: dispatches packets (evidence: `http.py`)
- Request Analyzer → Body Decoder: decodes raw payload (evidence: `http.py`)
- Request Analyzer → Console Output: prints request (evidence: `http.py`)
- Body Decoder → Console Output: prints body (evidence: `http.py`)
