Skip to content

A lightweight mock server that simulates Xtream Codes API endpoints for IPTV application development and testing, deployed on Cloudflare Workers.

Notifications You must be signed in to change notification settings

j2jstudio/xtream-codes-mock-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xtream Codes Mock API Server on Cloudflare Workers

A lightweight mock server that simulates Xtream Codes API endpoints for IPTV application development and testing, deployed on Cloudflare Workers.

This project is intended for testing the Wizju IPTV Player (https://github.com/j2jstudio/wizju-iptv-player). The online player for live testing is available at https://wizju.com/iptv-online-player.

Test Credentials

  • Username: test_user
  • Password: test_pass

Quick Start

Prerequisites

Local Development

  1. Clone the repository:

    git clone https://github.com/j2jstudio/xtream-codes-mock-api.git
    cd xtream-codes-mock-api
  2. Install dependencies:

    pnpm install
  3. Run the development server:

    pnpm dev

    The mock server will be running on http://localhost:8787.

Deployment

To deploy the mock server to your Cloudflare account, run:

pnpm deploy

After deployment, Wrangler will provide you with the URL to your live worker.

API Usage

You can use any IPTV client or testing tool (like Postman or Bruno) to interact with the API.

  • Player API URL: https://<your-worker-url>/player_api.php
  • Username: test_user
  • Password: test_pass

Example cURL Commands

Authenticate and get user info:

curl "https://<your-worker-url>/player_api.php?username=test_user&password=test_pass"

Get live stream categories:

curl "https://<your-worker-url>/player_api.php?username=test_user&password=test_pass&action=get_live_categories"

Get live streams:

curl "https://<your-worker-url>/player_api.php?username=test_user&password=test_pass&action=get_live_streams"

Demo

https://xtream-codes-mock-api.wizju.com/player_api.php?username=test_user&password=test_pass
https://xtream-codes-mock-api.wizju.com/player_api.php?username=test_user&password=test_pass&action=get_live_categories
https://xtream-codes-mock-api.wizju.com/player_api.php?username=test_user&password=test_pass&action=get_live_streams
https://xtream-codes-mock-api.wizju.com/player_api.php?username=test_user&password=test_pass&action=get_live_streams&category_id=1
https://xtream-codes-mock-api.wizju.com/player_api.php?username=test_user&password=test_pass&action=get_vod_categories
https://xtream-codes-mock-api.wizju.com/player_api.php?username=test_user&password=test_pass&action=get_series_categories
https://xtream-codes-mock-api.wizju.com/player_api.php?username=test_user&password=test_pass&action=get_series
https://xtream-codes-mock-api.wizju.com/player_api.php?username=test_user&password=test_pass&action=get_series_info&series_id=1

Acknowledgements

This project was inspired by the excellent work on bsogulcan/xtream-codes-mock-server. A big thank you to the original author for providing a great foundation.

About

A lightweight mock server that simulates Xtream Codes API endpoints for IPTV application development and testing, deployed on Cloudflare Workers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published