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 🙏

© 2024 – Pkg Stats / Ryan Hefner

redrouter

v0.3.3

Published

modular reverse proxy for nodejs

Downloads

7

Readme

RedRouter

Build Status npm version

RedRouter is a universal reverse-proxy developed in Node.JS. It is designed to be modular as possible, allowing you to use whatever Backend, Resolver and Proxy Agent you wish. What are these things, you ask?

Design

Backend

Backends are used to store the proxy records themselves. By default, RedRouter stores proxy records in a memory cache, but you can additionally choose to search the following:

  • [X] etcd
  • [ ] memcached
  • [ ] mongodb
  • [ ] mysql
  • [ ] redis
  • [ ] consul

once a record has been found, it is added to the local memory cache, to reduce the time for subsequent requests.

Resolvers

Resolvers are used to find the proxy record matching a particular request. This is usually protocol-specific as different request headers require different methods of matching. Some that have been implemented:

  • [X] HTTP / HTTPS
  • [X] SSH (Username)

Middleware

Your application can optionally implement a middleware stack, used to transform the content of proxy records. This could be anything- logging, load balancing, even Docker discovery. As with other middleware stacks, order does matter- so be sure to document this in developing your middleware.

  • [X] docker resolution
  • [ ] round robin
  • [ ] dynamic load balancing

Proxy Agent

Proxy agents forward the content to a destination given the route provided by the resolver. Some that have been implemented:

  • [X] HTTP
  • [X] HTTPS
  • [ ] TCP
  • [X] SSH (Requires SSH Resolver)
  • [X] SSH over WebSockets (Basic wrapper used by Wetty)

Getting Started

Examples

Encryption

If you wish to use encryption (for HTTPS, etc), you can pass options into the SSL object:

ssl: {
  key : fs.readFileSync('/root/local/host.key'),
  cert : fs.readFileSync('/root/local/host.cert')
}

Logging

RedRouter uses Winston logging throughout.

API

Contributing

RedRouter began by merging code from the RedBird and RedWire projects. Thanks to them for their incredible contribuitions!

Because of its modularity, contributing to the RedRouter project is easy. Simply make a feature request in the issues, so that we can discuss any details, and you can ask any questions that arise. Right now, packages in the /agent, /backend, /middleware and /resolver folders will all be included in the core module- but to reduce the number of dependencies in the future, these will be moved to separate repositories.