# eddy165/private-web-access-ssh architecture

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

- Interactive diagram: https://gitdiagram.com/eddy165/private-web-access-ssh
- Repository: https://github.com/eddy165/private-web-access-ssh

## Overview

This repository demonstrates private web access through an SSH local port forward. The principal flow is browser → client-side forwarded port → encrypted SSH connection → server-side loopback web service. The Python service serves a static page and status/health endpoints; documented PowerShell utilities support starting and checking the server and tunnel. Tunnel behavior and the utilities are described in the README, but their source was not sampled, so those links rely on that documentation rather than inspected implementations.

Main entry points: [`private-web-access-ssh/private_web/server.py`](https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/private_web/server.py) (Python HTTP server), [`private-web-access-ssh/scripts/start_tunnel.ps1`](https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/scripts/start_tunnel.ps1) (Tunnel startup), [`private-web-access-ssh/scripts/start_private_server.ps1`](https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/scripts/start_private_server.ps1) (Server startup), [`private-web-access-ssh/scripts/check_server.ps1`](https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/scripts/check_server.ps1) (Server checks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client access"]
  node_local_forward["Local forward :8080"]
end

subgraph group_tunnel["SSH transport"]
  node_ssh_client["OpenSSH client"]
  node_ssh_server["OpenSSH server"]
  node_tunnel_start["Tunnel startup<br/>[start_tunnel.ps1]"]
end

subgraph group_service["Private web service"]
  node_private_server["Python HTTP server<br/>[server.py]"]
  node_web_page["Static web page<br/>[index.html]"]
  node_status_api["Status endpoint<br/>[server.py]"]
  node_health_endpoint["Health endpoint<br/>[server.py]"]
  node_server_start["Server startup"]
end

subgraph group_verification["Connectivity tools"]
  node_server_check["Server checks<br/>[check_server.ps1]"]
  node_tunnel_check["Tunnel checks<br/>[check_tunnel.ps1]"]
end

node_browser(("Web browser"))

node_browser -->|"requests via"| node_local_forward
node_local_forward -->|"forwards through"| node_ssh_client
node_ssh_client -->|"connects encrypted"| node_ssh_server
node_ssh_server -->|"forwards to loopback"| node_private_server
node_private_server -->|"serves"| node_web_page
node_server_start -.->|"starts"| node_private_server
node_tunnel_start -.->|"starts"| node_ssh_client
node_server_check -.->|"checks"| node_private_server
node_tunnel_check -.->|"checks"| node_ssh_client

click node_private_server "https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/private_web/server.py"
click node_web_page "https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/private_web/static/index.html"
click node_status_api "https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/private_web/server.py"
click node_health_endpoint "https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/private_web/server.py"
click node_server_start "https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/scripts/start_private_server.ps1"
click node_tunnel_start "https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/scripts/start_tunnel.ps1"
click node_server_check "https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/scripts/check_server.ps1"
click node_tunnel_check "https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/scripts/check_tunnel.ps1"

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_local_forward,node_browser toneBlue
class node_ssh_client,node_ssh_server,node_tunnel_start toneAmber
class node_private_server,node_web_page,node_status_api,node_health_endpoint,node_server_start toneMint
class node_server_check,node_tunnel_check toneRose
```

## Components

### Client access

- **Local forward :8080**

### SSH transport

- **OpenSSH client**
- **OpenSSH server**
- [Tunnel startup](https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/scripts/start_tunnel.ps1): `private-web-access-ssh/scripts/start_tunnel.ps1`

### Private web service

- [Python HTTP server](https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/private_web/server.py): `private-web-access-ssh/private_web/server.py`
- [Static web page](https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/private_web/static/index.html): `private-web-access-ssh/private_web/static/index.html`
- [Status endpoint](https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/private_web/server.py): `private-web-access-ssh/private_web/server.py`
- [Health endpoint](https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/private_web/server.py): `private-web-access-ssh/private_web/server.py`
- [Server startup](https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/scripts/start_private_server.ps1): `private-web-access-ssh/scripts/start_private_server.ps1`

### Connectivity tools

- [Server checks](https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/scripts/check_server.ps1): `private-web-access-ssh/scripts/check_server.ps1`
- [Tunnel checks](https://github.com/eddy165/private-web-access-ssh/blob/main/private-web-access-ssh/scripts/check_tunnel.ps1): `private-web-access-ssh/scripts/check_tunnel.ps1`

### Other components

- **Web browser**

## Connections

- Web browser → Local forward :8080: requests via (evidence: `README.md`)
- Local forward :8080 → OpenSSH client: forwards through (evidence: `README.md`)
- OpenSSH client → OpenSSH server: connects encrypted (evidence: `README.md`)
- OpenSSH server → Python HTTP server: forwards to loopback (evidence: `README.md`)
- Python HTTP server → Static web page: serves (evidence: `private-web-access-ssh/private_web/server.py`)
- Server startup → Python HTTP server: starts (evidence: `README.md`)
- Tunnel startup → OpenSSH client: starts (evidence: `README.md`)
- Server checks → Python HTTP server: checks (evidence: `README.md`)
- Tunnel checks → OpenSSH client: checks (evidence: `README.md`)
