# gkbrk/slowloris architecture

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

- Interactive diagram: https://gitdiagram.com/gkbrk/slowloris
- Repository: https://github.com/gkbrk/slowloris

## Overview

Slowloris is a command-line HTTP connection-exhaustion tool. The user supplies a target and options; the main loop opens a configured socket pool, sends incomplete requests and periodic keep-alive headers, replaces failed sockets, and repeats until interrupted. The map separates configuration, connection setup, request generation, and the runtime loop. README documents optional HTTPS and SOCKS5 modes; relationships among these capabilities are shown only where the source or README supports them.

Main entry points: [`slowloris.py`](https://github.com/gkbrk/slowloris/blob/master/slowloris.py) (Keep-alive iteration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_configuration["Configuration"]
  node_arguments["Argument parsing<br/>[slowloris.py]"]
  node_proxy["SOCKS5 proxy mode<br/>[slowloris.py]"]
  node_https["HTTPS mode<br/>[slowloris.py]"]
end

subgraph group_connections["Connections"]
  node_socket_setup["Socket setup<br/>[slowloris.py]"]
  node_tls["TLS wrapping<br/>[slowloris.py]"]
end

subgraph group_request["Request traffic"]
  node_initial_request["Initial request<br/>[slowloris.py]"]
  node_user_agent["User-Agent selection<br/>[slowloris.py]"]
  node_header_helpers["Header helpers<br/>[slowloris.py]"]
end

subgraph group_runtime["Runtime"]
  node_socket_pool[("Open socket pool<br/>[slowloris.py]")]
  node_main_loop["Main loop<br/>[slowloris.py]"]
  node_iteration["Keep-alive iteration<br/>[slowloris.py]"]
  node_replacement["Socket replacement<br/>[slowloris.py]"]
end

node_operator(("CLI user"))
node_target(("Target server"))
node_socks_service(("SOCKS5 proxy"))

node_operator -->|"provides options"| node_arguments
node_main_loop -->|"reads settings"| node_arguments
node_arguments -->|"enables optional"| node_proxy
node_arguments -->|"enables optional"| node_https
node_main_loop -->|"opens sockets"| node_socket_setup
node_socket_setup -->|"wraps optionally"| node_tls
node_proxy -.->|"connects through"| node_socks_service
node_socket_setup -->|"connects to"| node_target
node_socket_setup -->|"sends request"| node_initial_request
node_initial_request -->|"formats headers"| node_header_helpers
node_initial_request -->|"selects agent"| node_user_agent
node_main_loop -->|"fills pool"| node_socket_pool
node_main_loop -->|"repeats"| node_iteration
node_iteration -->|"sends keep-alives"| node_socket_pool
node_iteration -->|"replenishes sockets"| node_replacement
node_replacement -->|"opens replacements"| node_socket_setup
node_iteration -->|"formats headers"| node_header_helpers
node_iteration -->|"sends headers"| node_target

click node_arguments "https://github.com/gkbrk/slowloris/blob/master/slowloris.py"
click node_proxy "https://github.com/gkbrk/slowloris/blob/master/slowloris.py"
click node_https "https://github.com/gkbrk/slowloris/blob/master/slowloris.py"
click node_socket_setup "https://github.com/gkbrk/slowloris/blob/master/slowloris.py"
click node_tls "https://github.com/gkbrk/slowloris/blob/master/slowloris.py"
click node_initial_request "https://github.com/gkbrk/slowloris/blob/master/slowloris.py"
click node_user_agent "https://github.com/gkbrk/slowloris/blob/master/slowloris.py"
click node_header_helpers "https://github.com/gkbrk/slowloris/blob/master/slowloris.py"
click node_socket_pool "https://github.com/gkbrk/slowloris/blob/master/slowloris.py"
click node_main_loop "https://github.com/gkbrk/slowloris/blob/master/slowloris.py"
click node_iteration "https://github.com/gkbrk/slowloris/blob/master/slowloris.py"
click node_replacement "https://github.com/gkbrk/slowloris/blob/master/slowloris.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_arguments,node_proxy,node_https,node_operator toneBlue
class node_socket_setup,node_tls toneAmber
class node_initial_request,node_user_agent,node_header_helpers,node_target toneMint
class node_socket_pool,node_main_loop,node_iteration,node_replacement toneRose
class node_socks_service toneIndigo
```

## Components

### Configuration

- [Argument parsing](https://github.com/gkbrk/slowloris/blob/master/slowloris.py): `slowloris.py`
- [SOCKS5 proxy mode](https://github.com/gkbrk/slowloris/blob/master/slowloris.py): `slowloris.py`
- [HTTPS mode](https://github.com/gkbrk/slowloris/blob/master/slowloris.py): `slowloris.py`

### Connections

- [Socket setup](https://github.com/gkbrk/slowloris/blob/master/slowloris.py): `slowloris.py`
- [TLS wrapping](https://github.com/gkbrk/slowloris/blob/master/slowloris.py): `slowloris.py`

### Request traffic

- [Initial request](https://github.com/gkbrk/slowloris/blob/master/slowloris.py): `slowloris.py`
- [User-Agent selection](https://github.com/gkbrk/slowloris/blob/master/slowloris.py): `slowloris.py`
- [Header helpers](https://github.com/gkbrk/slowloris/blob/master/slowloris.py): `slowloris.py`

### Runtime

- [Open socket pool](https://github.com/gkbrk/slowloris/blob/master/slowloris.py): `slowloris.py`
- [Main loop](https://github.com/gkbrk/slowloris/blob/master/slowloris.py): `slowloris.py`
- [Keep-alive iteration](https://github.com/gkbrk/slowloris/blob/master/slowloris.py): `slowloris.py`
- [Socket replacement](https://github.com/gkbrk/slowloris/blob/master/slowloris.py): `slowloris.py`

### Other components

- **CLI user**
- **Target server**
- **SOCKS5 proxy**

## Connections

- CLI user → Argument parsing: provides options (evidence: `slowloris.py`)
- Main loop → Argument parsing: reads settings (evidence: `slowloris.py`)
- Argument parsing → SOCKS5 proxy mode: enables optional (evidence: `slowloris.py`)
- Argument parsing → HTTPS mode: enables optional (evidence: `slowloris.py`)
- Main loop → Socket setup: opens sockets (evidence: `slowloris.py`)
- Socket setup → TLS wrapping: wraps optionally (evidence: `slowloris.py`)
- SOCKS5 proxy mode → SOCKS5 proxy: connects through (evidence: `README.md`)
- Socket setup → Target server: connects to (evidence: `slowloris.py`)
- Socket setup → Initial request: sends request (evidence: `slowloris.py`)
- Initial request → Header helpers: formats headers (evidence: `slowloris.py`)
- Initial request → User-Agent selection: selects agent (evidence: `slowloris.py`)
- Main loop → Open socket pool: fills pool (evidence: `slowloris.py`)
- Main loop → Keep-alive iteration: repeats (evidence: `slowloris.py`)
- Keep-alive iteration → Open socket pool: sends keep-alives (evidence: `slowloris.py`)
- Keep-alive iteration → Socket replacement: replenishes sockets (evidence: `slowloris.py`)
- Socket replacement → Socket setup: opens replacements (evidence: `slowloris.py`)
- Keep-alive iteration → Header helpers: formats headers (evidence: `slowloris.py`)
- Keep-alive iteration → Target server: sends headers (evidence: `README.md`)
