InstaGhost โ Social Media Media Viewer & Edge Streaming Engine
A high-performance, full-stack web application designed for anonymous, low-latency viewing and downloading of public social media content (Stories, Reels, Carousels, and High-Definition Profiles), engineered with a dual-target architecture: a serverless edge runtime running on Cloudflare Pages and a containerized Node.js streaming backend.
โกOverview & Dual-Target Architecture
InstaGhost is an enterprise-grade, privacy-first web utility engineered for anonymous, low-latency viewing and downloading of public social media contentโincluding ephemeral Stories, Reels, multi-slide Carousels, and High-Definition profile picturesโwithout requiring account credentials or leaving digital tracking footprints.
๐๏ธ Dual-Target Runtime Architecture
To achieve extreme global responsiveness while supporting heavy continuous binary data transfers, the platform was architected with a decoupled dual-target runtime:
- Serverless Edge Runtime (Cloudflare Pages & Workers): Executes request routing, bot mitigation, edge cache lookups, and token authentication within V8 Isolates distributed across 300+ global edge locations.
- Containerized Node.js Streaming Cluster: Manages high-throughput binary proxying, long-lived HTTP Range pipelines, and upstream CDN socket pooling without exhausting server RAM.
๐ก๏ธZero-Footprint Anonymous Access
Browsing social media platforms natively requires active user sessions, third-party cookies, and tracking pixels that log view counts, timestamps, and IP addresses. InstaGhost acts as an air-gapped cryptographic barrier:
- Zero viewer authentication cookies or session states transmitted to upstream hosts.
- Ephemeral stories can be inspected without triggering "Seen" telemetry receipts.
- All client requests terminate at the edge; upstream networks only see isolated proxy pools.
๐Zero-Buffer Media Streaming & Reverse Proxy
Traditional media download utilities buffer entire video files (e.g. 50MB to 200MB 4K Reels) into application server RAM before transmitting bytes to the user. Under heavy concurrency, this causes severe memory bloat, high GC pauses, and server crashes.
๐ Direct Binary Pipeline via HTTP Streams
InstaGhost eliminates in-memory buffering using the modern HTTP Streams API and Undici stream dispatchers:
- Direct Chunk Piping: Video chunks incoming from upstream CDNs are immediately piped chunk-by-chunk to the client response stream with zero intermediate disk writes or memory retention.
- HTTP Range (`206 Partial Content`): Full passthrough of byte-range headers enables native browser video players to seek forward/backward with instant scrubbing, requesting only required segments without downloading full files.
- Constant RAM Footprint: Server memory usage remains static at <50MB even when processing thousands of concurrent high-bitrate media streams.
โฉHTTP Range Header Forwarding
When an HTML5 <video> element initiates playback, it requests specific byte windows (e.g., bytes=0-1048575). The streaming engine validates, signs, and proxies these byte offsets directly:
Range: bytes=1048576-2097151
// Engine pipes directly with 206 Partial Content
HTTP/1.1 206 Partial Content
Content-Range: bytes 1048576-2097151/15728640
Content-Type: video/mp4
๐Edge-First Global Runtime & Caching
By leveraging Cloudflare Pages & Workers running on V8 Isolates, user requests hit edge nodes physically closest to them, virtually eliminating geographic network latency.
Static user assets, public avatar thumbnails, and sanitized profile metadata are automatically cached across Cloudflare edge tiers using tailored Cache-Control and stale-while-revalidate policies, shielding origin nodes from redundant API queries.
๐Resilient Network Layer & Concurrency Locks
Public social media endpoints enforce strict rate limits and IP reputation filters. To guarantee 99.99% uptime and prevent traffic blacklisting, InstaGhost utilizes a multi-layer network dispatcher:
- Automated Proxy Dispatcher & Port Rotation: Outbound queries cycle through dedicated IP pools using round-robin port allocation with health checks, dynamically evicting degraded egress nodes.
- Resilient Undici Connection Pooling: Maintains persistent TCP keep-alive sockets, eliminating TLS handshake overhead on rapid repetitive requests.
- Token Lifecycle Management & Mutex Lockouts: Concurrency locks guarantee that simultaneous identical user requests (e.g., when a viral profile is searched by hundreds of users at once) coalesce into a single upstream fetch, thwarting thundering-herd bottlenecks.
๐Multi-Layered Security & Bot Mitigation
Reverse proxy engines handling dynamic external URLs face severe security vectors, most notably Server-Side Request Forgery (SSRF) and scraper abuse. InstaGhost implements strict defense-in-depth protocols:
| Defense Layer | Implementation Mechanism |
|---|---|
| SSRF IP Validation | Strict DNS pre-resolution & CIDR validation blocking loopback (127.0.0.1), private subnets (RFC 1918), link-local (169.254.0.0/16), and cloud metadata endpoints. |
| CORS Policy | Origin whitelisting rejecting unauthorized cross-site iframe embedding and API scraping. |
| Turnstile CAPTCHA | Cloudflare Turnstile token validation challenging suspicious automated bot traffic. |
| Pre-Shared Auth | Cryptographic HMAC token signatures preventing arbitrary public URL proxy exploitation. |
| Helmet & Rate Limiting | Content Security Policies, HSTS, X-Content-Type-Options headers, and sliding-window rate limiters. |
๐Headless WordPress & Decoupled CMS Integration
To enable easy deployment across existing publishing properties and high-ranking SEO domains without exposing the Node.js cluster, a custom Headless PHP Integration Layer was architected:
- Custom WordPress REST API Endpoints: Acts as a secured intermediary that communicates with edge proxies using signed internal tokens.
- Reusable Shortcodes & Gutenberg Blocks: Enables content editors to embed story viewers, reel downloaders, or profile inspectors onto any WordPress page or post with simple markup (
[instaghost_viewer mode="story"]). - Origin Shielding: The core streaming cluster IP remains completely hidden from DNS registries and public scrutiny.
๐จVanilla Frontend Engine & Interactive UX
The client interface was handcrafted in pure Vanilla JavaScript (ES6+) and CSS3 with zero third-party framework runtime overhead, delivering instant page loads and 60 FPS mobile animations.
โฑ๏ธ Multi-Segment Story Timers
Custom segmented progress bars matching native mobile Instagram story playback with pause, resume, and auto-advance mechanics.
๐ Hold-to-Pause Touch Listeners
Intuitive gesture handlers that freeze playback timers and hide UI overlays when holding down on mobile screens or desktop mouse click.
๐ Touch Carousel Sliders
Zero-dependency swipeable carousels supporting multi-image album posts with inertia physics and dot indicators.
๐ System-Aware Dark Mode
Pure CSS custom variable theme architecture that automatically adapts to the user's operating system preferences with zero flash of unstyled content.
๐ ๏ธTechnology Stack Specifications
| Category | Technologies | Architectural Role |
|---|---|---|
| Backend & Edge | Node.js, Express, Cloudflare Pages / Workers, Undici, HTTP Streams API | V8 Isolate routing, high-throughput reverse proxying, connection pooling |
| Frontend UI | Vanilla JavaScript (ES6+), CSS3 Variables & Keyframes, HTML5 Semantic Web | Zero-dependency client, story progress timers, hold-to-pause listeners |
| CMS Integration | PHP, WordPress REST API, Cloudflare Turnstile | Decoupled content syndication, custom shortcodes, bot challenge verification |
| Security & Network | SSRF IP Filter, CORS Whitelist, Proxy Dispatcher, Helmet, Rate Limiter | Defense-in-depth protection, thundering-herd concurrency lockouts |
FROM CONCEPT TO CODE </>
LET'S TURN IDEAS INTO SOLUTIONS
I'm available for full-time roles & freelance projects.
I thrive on crafting dynamic web applications
and delivering seamless user experiences.