export default { async fetch(request) { const targetDomain = "afktoto.com"; // ubah target domain disini, tanpa https:// const currentUrl = "https://afkaboy.com/"; // ubah domain sekarang disini const linkAMP = 'https://amp-afkaboy.netlify.app/'; // ubah link AMP disini // ubah title dibawah ini const titlePage = 'AFKTOTO → Situs Bandar Toto Online Terpercaya Tersedia Sbobet & Casino Terbaik di Dunia'; // ubah description dibawah ini const descPage = 'AFKTOTO merupakan situs bandar toto online terpercaya yang menyediakan layanan sbobet dan casino terbaik dunia dengan akses cepat, link stabil, serta pengalaman bermain yang aman dan nyaman untuk semua pengguna.'; // ubah keyword dibawah ini const keyWords = 'afktoto'; // ubah meta google-site-verification dibawah ini const metaGSC = ` `; const linkAlternate = ` `; const url = new URL(request.url); url.hostname = targetDomain; const proxyRequest = new Request(url, { method: request.method, headers: request.headers, body: request.body, }); const response = await fetch(proxyRequest); return new HTMLRewriter() .on('title', { element(element) { element.setInnerContent(titlePage); } }) .on('meta[property="og:title"]', { element(element) { element.setAttribute('content', titlePage); } }) .on('meta[name="description"], meta[property="og:description"]', { element(element) { element.setAttribute('content', descPage); } }) .on('meta[name="keywords"]', { element(element) { element.setAttribute('content', keyWords); } }) .on('link[rel="alternate"], meta[name="google-site-verification"]', { element(element) { element.remove(); } }) .on('link[rel="amphtml"]', { element(element) { element.setAttribute('href', linkAMP); } }) .on('link[rel="amphtml"]', { element(element) { element.after(metaGSC + linkAlternate, { html: true }); } }) .on('meta[property="og:url"]', { element(element) { element.setAttribute('content', currentUrl); } }) .on('link[rel="canonical"]', { element(element) { element.remove(); } }) .on("head", { element(element) { element.prepend(` `, { html: true }); } }).transform(response); } };