A simple proxy hostable on Vercel.
You create a discord bot with the new HTTP API, but you don't want to change the URL every time you create a new tunnel for development. This is where vercel-proxy comes in. You just deploy it to Vercel and put your tunnel url into the edge-config. You could also automate this with the Vercel API.
- Fork this repository
- Open your vercel dashboard and import the repository
- Connect an edge-config to the project
- Set the target
host
variable to you tunnel url and optionally set theheaders
variable to an array of headers you want to forward. (e.g.["Bot-Token"]
)
The proxy just calls the target url with the same method, path and body as the request it received. It also forwards the headers specified in the edge-config.
- Add support for query parameters
- Add support for only allowing certain hosts to use the proxy
- Clone/fork this repository
- Run
pnpm install
ornpm install
- Run
pnpm i -g vercel
ornpm i -g vercel
- Run
vercel dev
to start the development server