A simple, modern JavaScript reverse-proxy that has no dependencies and only uses the JavaScript standard library.
Also works for all major JS platforms.
PROXY_URL=https://wherever.com
PROXY_KEY=SOME_SECRET_STRING
If you have the PROXY_KEY
set (optional), then the request must include one of the following
that matches:
X-Proxy-Key
headerproxyKey
query param
node --env-file=.env node.js
NODE_TLS_REJECT_UNAUTHORIZED=0 bun bun.js
TODO: make docs for this.
Use worker.js
Install pm2:
npm install -g pm2
Then start this with:
pm2 start node.js
To run it with bun:
pm2 start --interpreter ~/.bun/bin/bun bun.js