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

maegashira

v0.0.3

Published

Maegashira, a fast and dynamic reverse proxy based on the Bun runtime.

Downloads

6

Readme

  __  __                                        _       _                
 |  \/  |   __ _    ___    __ _    __ _   ___  | |__   (_)  _ __    __ _ 
 | |\/| |  / _` |  / _ \  / _` |  / _` | / __| | '_ \  | | | '__|  / _` |
 | |  | | | (_| | |  __/ | (_| | | (_| | \__ \ | | | | | | | |    | (_| |
 |_|  |_|  \__,_|  \___|  \__, |  \__,_| |___/ |_| |_| |_| |_|     \__,_|
                          |___/                                          

A fast and dynamic reverse proxy based on the Bun runtime, designed to be easy to use, configure and extend.
Use it off-the-shelf from Docker, a CLI or build your own custom reverse proxy.

Key Features

Routing:

  • Hostname and path-based resolver
  • HTTP Forwarding and static files serving
  • Upstreams load balancing

Middlewares

  • Write custom logic with JavaScript or TypeScript
  • Pre-processing: Manipulating request headers, query string, and request body.
  • Post-processing: Manipulating response headers, query string, and response body.

Clustering:

  • Distribute workload across worker process
  • Distribute workload across servers
  • Centralized state with Redis

Management API:

  • Routing table: Defining routes and their corresponding targets.
  • Proxy health checks: Monitoring the health of the proxy.
  • Metrics: Collecting and exposing Prometheus metrics for monitoring and alerting.

Quick Start

The easieat way to get started is to use Docker:

docker run -p 8080:8080 -p 8081:8081 maegashira

Alternatively, if you have bun installed, you can run it directly:

bunx maegashira

Or install it globally:

bun install -g maegashira
maegashira

Build your own reverse proxy

Look at the custom-proxy example for a minimalistic example of a custom reverse proxy.

Roadmap

Load balancing:

  • Regular health monitoring of backend servers and rerouting traffic in case of failure
  • Round-robin strategy
  • Least connections strategy
  • IP-hash strategy
  • Sticky sessions strategy

Routing:

  • SSL offloading
  • Custom resolver middleware
  • Host header rewriting
  • "redirect" target type
  • Retry strategies
  • Rate limiting strategies
  • Configurable caching strategies

Proxy:

  • Support for websockets
  • Support for HTTP/2
  • Support for gRPC
  • Support for HTTP/3

Discovery:

  • Routes discovery from config file
  • Routes discovery from config url
  • Services and routes discovery from Docker
  • Routes discovery from Kubernetes

Security:

  • Support for forward targets basic authentication strategy
  • Support for files-based TLS certificates
  • Automatic certificate renewal via Let's Encrypt
  • Web Application Firewall (WAF): Protection against common web vulnerabilities (e.g., SQL injection, XSS).
  • IP filtering
  • Rate limiting

Monitoring:

  • File transport
  • Prometheus metrics
  • OpenTelmetry integration