A. The mirrors.json Configuration
You host a configuration file that lists all your active mirrors.
[
"id": 1,
"type": "primary",
"url": "https://yourname.github.io",
"status": "active"
,
"id": 2,
"type": "backup",
"url": "https://yourgamestack.vercel.app",
"status": "standby"
,
"id": 3,
"type": "backup",
"url": "https://yourgamestack.netlify.app",
"status": "standby"
]
B. The JavaScript Logic (Simplified)
const mirrors = [ "https://primary.github.io/games/", "https://backup1.vercel.app/games/", "https://backup2.netlify.app/games/" ];async function findWorkingMirror() for (let url of mirrors) try // Try to fetch a tiny header file to check connectivity const response = await fetch(url + 'ping.json', method: 'HEAD', mode: 'no-cors' ); // Note: 'no-cors' limits what you can read, but success/failure usually works for connectivity checks return url; catch (error) console.log("Mirror blocked or down: " + url); return null; // All mirrors blocked github io unblocked games
// On page load window.addEventListener('DOMContentLoaded', async () => const workingUrl = await findWorkingMirror(); if (workingUrl) // Update all game links to use the working URL document.querySelectorAll('.game-link').forEach(link => link.href = workingUrl + link.dataset.gamePath; ); else document.body.innerHTML = "<h1>All connections blocked. Please use the Discord link for new URLs.</h1>"; );// On page load window
Looking for recommendations? These are the most searched and played games currently hosted on the github.io platform. Bookmark this list. // On page load window.addEventListener('DOMContentLoaded'
The rhythm game sensation. On GitHub Pages, you can find the "Psych Engine" port, which includes the entire base game plus hundreds of fan-made songs without downloading 2GB of files.