Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌐 Discord Proxy

A simple, lightweight, and easy-to-deploy Discord proxy that works with both Cloudflare Workers and Vercel Serverless Functions.

✨ Features

  • One-click deployment to Cloudflare Workers or Vercel
  • Works with any Discord webhook - just pass the ID and token
  • Works with any Discord API

🚀 Deploy in One Click - Ranked

Platform Deploy
Cloudflare Workers Deploy to Cloudflare
Vercel Deploy with Vercel
Netlify Deploy to Netlify

💻 Code - Standalone

import http from "http";
http.createServer(async (req, res) => {
  const url = new URL(req.url, `http://${req.headers.host}`);
  const webhookMatch = url.pathname.match(/^\/api\/webhooks\/(\d+)\/([^\/]+)/);
  const apiMatch = url.pathname.match(/^\/discord(\/.*)?$/);
  let targetUrl;
  if (webhookMatch) {
    targetUrl = `https://discord.com/api/webhooks/${webhookMatch[1]}/${webhookMatch[2]}`;
  } else if (apiMatch) {
    targetUrl = `https://discord.com/api${apiMatch[1] || ""}${url.search}`;
  } else {
    res.writeHead(200);
    return res.end("Use: /api/webhooks/ID/TOKEN or /discord/v10/...");
  }
  const response = await fetch(targetUrl, {
    method: req.method,
    headers: req.headers,
    body: req.method !== "GET" && req.method !== "HEAD" ? req : null,
  });
  const body = response.status === 204 ? "" : await response.text();
  res.writeHead(response.status);
  res.end(body);
}).listen(3000);

About

A simple proxy for discord webhooks. It will hide your IP Address

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages