npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

run-proxy-server

v1.0.0

Published

Simple tool to proxy HTTP/HTTPS requests via a local Node.js server with built-in caching

Readme

run-proxy-server

cli-available node version npm version downloads size license github-ci

Simple CLI tool to run a local HTTP/HTTPS proxy server with built-in caching, powered by vanilla Node.js.

Give a ⭐️ if this project helped you!

Features

  • 🚀 Create a local proxy server (HTTP or HTTPS)
  • ⚡ Cache proxied responses to avoid redundant network requests
  • 💾 Cache stored in .cache/ directory, keyed by MD5 hash of the full URL
  • 🧰 Supports a denylist to exclude specific URLs or patterns from caching
  • 🎯 Denylist patterns support wildcards (*)

Quick Start

Install

npm install -g run-proxy-server

Or run without installing:

npx run-proxy-server http://example.com --port 8000

One-time HTTPS setup

If you plan to proxy an HTTPS target, run this once first:

run-proxy-server --setup-https
# or
npx run-proxy-server --setup-https

This creates certs/key.pem and certs/cert.pem for local HTTPS.

HTTP

run-proxy-server http://example.com --port 8000

Then make requests to the proxy:

curl http://localhost:8000/

HTTPS

After the one-time HTTPS setup above, start the proxy pointing to an HTTPS target:

run-proxy-server https://example.com --port 8443

If you prefer manual certificate creation instead of --setup-https, you can run:

mkdir -p certs
openssl req -x509 -newkey rsa:2048 -keyout certs/key.pem -out certs/cert.pem -days 365 -nodes -subj "/CN=localhost"

Note: Browsers will show a security warning for self-signed certificates — this is expected in local development. For production, use a certificate from a trusted CA (e.g. Let's Encrypt).

Options

| Argument/Option | Required | Default | Description | | --------------- | -------- | ------- | -------------------------------------------------- | | URL | yes | — | Target URL to proxy requests to | | --port | no | 8000 | Port for the local proxy server | | --denylist | no | — | Comma-separated URL patterns to exclude from cache | | --no-cache | no | false | Disable cache reads and writes for this process | | --clear-cache | no | false | Remove all cached responses and exit | | --setup-https | no | false | Generate local HTTPS certificates and exit |

Examples

Proxy an API with caching

run-proxy-server https://api.github.com --port 8000

# First request — proxied and cached
curl http://localhost:8000/users/octocat

# Second request — served from cache (no network call)
curl http://localhost:8000/users/octocat

Exclude dynamic endpoints from cache

run-proxy-server https://example.com --port 8000 --denylist "*/api/*,*.json"

# API calls are never cached (always fresh)
curl http://localhost:8000/api/users

# Static assets are cached
curl http://localhost:8000/index.html

Disable cache entirely for a run

run-proxy-server https://example.com --port 8000 --no-cache

# Every request is fetched from upstream (cache is bypassed)
curl http://localhost:8000/

Denylist pattern syntax

Patterns are matched against the full URL. * matches any characters.

| Pattern | Matches | | --------------------------- | ------------------------------------- | | *.json | https://example.com/data.json | | */api/* | https://example.com/api/users | | */admin/* | https://example.com/admin/dashboard | | https://cdn.example.com/* | https://cdn.example.com/image.png |

Multiple patterns are separated by commas:

--denylist "*/api/*,*.json,*/admin/*"

Cache

  • First request: proxied to the target, response saved to .cache/
  • Subsequent requests: served directly from .cache/
  • Denylisted URLs: always fetched fresh, never cached
  • --no-cache mode: cache is fully disabled (no reads and no writes)

Clear the cache at any time:

run-proxy-server --clear-cache
# or
npx run-proxy-server --clear-cache

Development

Run with auto-reload on file changes:

npm run dev -- https://example.com --port 8000

Testing

npm test

Tests cover cache operations, denylist pattern matching, and error handling across Node.js 18, 20, 22, and 24.

🤝 Contributing

Contributions, issues and feature requests are welcome! Feel free to check issues page.

License

The MIT License @ 2026