I can see this is a GitHub repository for an M3U8 proxy server designed to handle CORS errors when streaming HLS (HTTP Live Streaming) files. Let me create a Next.js implementation of an M3U8 proxy server that can handle CORS issues for streaming media.
I've created a Next.js implementation of the M3U8 proxy server based on the GitHub repository you shared. This application provides:
Key Features:
- CORS-Free M3U8 Streaming: Proxies M3U8 playlist files and handles CORS headers properly
- User-Friendly Interface: Clean web interface to generate proxy URLs
- URL Processing: Automatically converts relative URLs in M3U8 files to absolute URLs
- Segment Proxying: Additional endpoint for proxying video segments if needed
How it works:
- Main Proxy Endpoint (
/api/proxy
): Fetches M3U8 playlist files and adds proper CORS headers - Segment Proxy Endpoint (
/api/segment
): Can proxy individual video segments if needed - URL Processing: Automatically handles relative URLs in M3U8 files by converting them to absolute URLs
- Web Interface: Provides an easy way to generate proxy URLs
Usage:
- Enter your original M3U8 URL in the input field
- Click "Generate Proxy URL" to create a CORS-free version
- Use the generated proxy URL in your video player or application
- The proxy will handle all CORS issues and serve the content properly
The server adds all necessary CORS headers and processes M3U8 content to ensure compatibility with web-based video players that would otherwise be blocked by CORS policies.