InstaGhost โ€” Social Media Media Viewer & Edge Streaming Engine

InstaGhost โ€” Social Media Media Viewer & Edge Streaming Engine

Node.jsExpressCloudflare PagesCloudflare WorkersUndiciHTTP Streams APIV8 IsolatesVanilla JS (ES6+)CSS3HTML5 Semantic WebPHPWordPress REST APICloudflare TurnstileSSRF ProtectionReverse Proxy

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:

GET /api/stream?src=... HTTP/1.1
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.

โšก Response LatencySub-50ms TTFB
โ„๏ธ Cold Start Time0ms (V8 Isolates)
๐ŸŒ Edge Locations300+ Cities

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 LayerImplementation Mechanism
SSRF IP ValidationStrict 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 PolicyOrigin whitelisting rejecting unauthorized cross-site iframe embedding and API scraping.
Turnstile CAPTCHACloudflare Turnstile token validation challenging suspicious automated bot traffic.
Pre-Shared AuthCryptographic HMAC token signatures preventing arbitrary public URL proxy exploitation.
Helmet & Rate LimitingContent 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

CategoryTechnologiesArchitectural Role
Backend & EdgeNode.js, Express, Cloudflare Pages / Workers, Undici, HTTP Streams APIV8 Isolate routing, high-throughput reverse proxying, connection pooling
Frontend UIVanilla JavaScript (ES6+), CSS3 Variables & Keyframes, HTML5 Semantic WebZero-dependency client, story progress timers, hold-to-pause listeners
CMS IntegrationPHP, WordPress REST API, Cloudflare TurnstileDecoupled content syndication, custom shortcodes, bot challenge verification
Security & NetworkSSRF IP Filter, CORS Whitelist, Proxy Dispatcher, Helmet, Rate LimiterDefense-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.