Skip to content

Instantly share code, notes, and snippets.

FROM debian:bookworm-slim
# Install build dependencies and Perl modules
RUN apt-get update && apt-get install -y \
build-essential \
libpcre3 \
libpcre3-dev \
zlib1g \
zlib1g-dev \
libssl-dev \
// Adjust proxy server to rewrite URLs
// Main proxy route that handles all incoming requests
// Takes a URL parameter that specifies which resource to proxy
app.get("/proxy/:url", async (req, res) => {
// Decode the URL parameter since it comes URL-encoded
const url = decodeURIComponent(req.params.url);
// Create URL object to help with resolving relative URLs later
const baseUrl = new URL(url);
try {