🤖 آریستا – لیست پراکسی‌های تلگرام

همه: … MTProto: … SOCKS5: … آخرین بروزرسانی: …
صفحه 1
/* ===== File: /worker/worker.js (Cloudflare Worker – optional API proxy + cache) ===== */ // Deploy with: wrangler deploy export default { async fetch(request, env, ctx) { const url = new URL(request.url); // CORS preflight if (request.method === 'OPTIONS') { return new Response(null, { headers: corsHeaders() }); } if (url.pathname.startsWith('/api/mtproto')) { return proxy('https://mtpro.xyz/api/?type=mtproto'); } if (url.pathname.startsWith('/api/socks')) { return proxy('https://mtpro.xyz/api/?type=socks'); } // Healthcheck if (url.pathname === '/health') return new Response('ok'); // Fallback: simple landing return new Response( 'API Proxy

Configure your site to call /api/mtproto و /api/socks.

', { headers: { 'content-type': 'text/html; charset=utf-8' } } ); async function proxy(target){ const cache = caches.default; const cacheKey = new Request(target, { headers: { accept: 'application/json' }}); let res = await cache.match(cacheKey); if (!res) { const upstream = await fetch(target, { cf: { cacheTtl: 60, cacheEverything: true } }); res = new Response(upstream.body, upstream); res.headers.set('cache-control', 'public, max-age=60'); res.headers.set('content-type', 'application/json; charset=utf-8'); await cache.put(cacheKey, res.clone()); } // Add permissive CORS return new Response(res.body, { headers: { ...Object.fromEntries(res.headers), ...corsHeaders() } }); } function corsHeaders(){ return { 'access-control-allow-origin': '*', 'access-control-allow-methods': 'GET, OPTIONS', 'access-control-allow-headers': 'Content-Type', }; } } } # ===== File: /worker/wrangler.toml ===== # name this anything you like name = "arista-api-proxy" main = "worker.js" compatibility_date = "2024-11-13" # Uncomment to add a custom route # routes = [ "api.your-domain.example/*" ]