# isfandiyor0112-star/iptv-proxy architecture

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

- Interactive diagram: https://gitdiagram.com/isfandiyor0112-star/iptv-proxy
- Repository: https://github.com/isfandiyor0112-star/iptv-proxy

## Overview

This small IPTV proxy exposes one playlist endpoint: a client requests a named channel, the server resolves its upstream playlist, fetches and rewrites segment references, and returns the playlist. Clients then fetch video segments directly from ITV rather than through the proxy. The source also enables CORS and handles preflight requests. The README is empty; the map is based on the sampled server.js only.

Main entry points: [`server.js`](https://github.com/isfandiyor0112-star/iptv-proxy/blob/main/server.js) (Playlist endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_client(("Player client"))
node_playlist_route["Playlist endpoint<br/>[server.js]"]
node_channel_map["Channel catalog<br/>[server.js]"]
node_playlist_fetch["Playlist fetch<br/>[server.js]"]
node_playlist_rewrite["Playlist rewrite<br/>[server.js]"]
node_cors["CORS middleware<br/>[server.js]"]
node_itv["ITV stream origin"]

node_client -->|"requests playlist"| node_playlist_route
node_playlist_route -->|"looks up channel"| node_channel_map
node_playlist_route -->|"fetches playlist"| node_playlist_fetch
node_playlist_fetch -->|"requests playlist"| node_itv
node_playlist_route -->|"rewrites playlist"| node_playlist_rewrite
node_playlist_route -->|"returns playlist"| node_client
node_client -->|"fetches segments"| node_itv
node_client -->|"sends requests"| node_cors

click node_playlist_route "https://github.com/isfandiyor0112-star/iptv-proxy/blob/main/server.js"
click node_channel_map "https://github.com/isfandiyor0112-star/iptv-proxy/blob/main/server.js"
click node_playlist_fetch "https://github.com/isfandiyor0112-star/iptv-proxy/blob/main/server.js"
click node_playlist_rewrite "https://github.com/isfandiyor0112-star/iptv-proxy/blob/main/server.js"
click node_cors "https://github.com/isfandiyor0112-star/iptv-proxy/blob/main/server.js"

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_client toneBlue
class node_playlist_route,node_channel_map,node_playlist_fetch,node_playlist_rewrite,node_cors toneTeal
class node_itv toneIndigo
```

## Components

### Other components

- **Player client**
- [Playlist endpoint](https://github.com/isfandiyor0112-star/iptv-proxy/blob/main/server.js): `server.js`
- [Channel catalog](https://github.com/isfandiyor0112-star/iptv-proxy/blob/main/server.js): `server.js`
- [Playlist fetch](https://github.com/isfandiyor0112-star/iptv-proxy/blob/main/server.js): `server.js`
- [Playlist rewrite](https://github.com/isfandiyor0112-star/iptv-proxy/blob/main/server.js): `server.js`
- [CORS middleware](https://github.com/isfandiyor0112-star/iptv-proxy/blob/main/server.js): `server.js`
- **ITV stream origin**

## Connections

- Player client → Playlist endpoint: requests playlist (evidence: `server.js`)
- Playlist endpoint → Channel catalog: looks up channel (evidence: `server.js`)
- Playlist endpoint → Playlist fetch: fetches playlist (evidence: `server.js`)
- Playlist fetch → ITV stream origin: requests playlist (evidence: `server.js`)
- Playlist endpoint → Playlist rewrite: rewrites playlist (evidence: `server.js`)
- Playlist endpoint → Player client: returns playlist (evidence: `server.js`)
- Player client → ITV stream origin: fetches segments
- Player client → CORS middleware: sends requests (evidence: `server.js`)
