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

haproxy-manager

v0.1.0

Published

Interactive CLI to manage HAProxy HTTP/HTTPS/TCP routes and generate haproxy.cfg

Readme

haproxy-manager

Interactive CLI to manage HAProxy routes (HTTP by domain, HTTPS by SNI, TCP passthrough) without hand-editing haproxy.cfg. Routes are stored in haproxy-data/routes.json and generated into haproxy-data/haproxy.cfg.

Usage (on your HAProxy server)

Without installing (npx / bunx)

npx haproxy-manager
# or
bunx haproxy-manager

Global install

npm install -g haproxy-manager
haproxy-manager

Local install (for development)

git clone https://github.com/fadlee/haproxy-manager.git
cd haproxy-manager
npm install
npm link          # makes the `haproxy-manager` command available globally
haproxy-manager

Or run it directly without linking:

node src/cli.js

Seed data

data/routes.seed.json holds a representation of the HAProxy config you had put together manually (vm1 by domain/SNI plus firebird/app/mysql/webnesia_mysql). To start from it, copy it to the active data location:

mkdir -p haproxy-data
cp data/routes.seed.json haproxy-data/routes.json

If haproxy-data/routes.json does not exist at all, the CLI creates an empty config on first run.

Menu

The main menu is intentionally short — the details live in submenus:

  • List all routes — show HTTP, HTTPS, and TCP routes (counts appear in the label)
  • Add route → pick a type:
    • HTTP (by domain) — name, domain suffixes (comma-separated), backend
    • HTTPS (by SNI) — same, but matched via SNI and TLS is forwarded untouched to the backend
    • TCP passthrough — open one port and forward it 1:1 to a backend (MySQL, Firebird, etc)
  • Modify route → Edit / Delete / Default backend HTTP or HTTPS
  • Generate, validate & reload config
    • Generate haproxy.cfg — rewrite haproxy-data/haproxy.cfg from current data
    • Validate haproxy.cfg — run haproxy -c -f ... (requires the haproxy binary on PATH)
    • Reload HAProxy service — run systemctl reload haproxy (requires permissions, try sudo)

Every submenu has a ← Back option to return to the main menu.

Each prompt also prints short inline hints (what a backend is, what send-proxy-v2 does, how domain/SNI suffixes match) so you do not need the docs.

Recommended workflow

  1. Add/edit routes through the CLI menu
  2. Generate haproxy.cfg
  3. Validate before using it
  4. If OK, copy haproxy-data/haproxy.cfg to your production HAProxy config location (or point HAPROXY_MANAGER_DIR straight at your HAProxy config folder, e.g. /etc/haproxy, so generate writes there directly — but back up first)
  5. Reload the service

Overriding the data location

HAPROXY_MANAGER_DIR=/etc/haproxy haproxy-manager

Notes

  • Validation and reload run locally on the machine where this CLI runs — so it is best used directly on the HAProxy server (via SSH), not from your laptop, unless you extend it yourself for remote exec over SSH.
  • For reload, the user running the CLI needs permission to systemctl reload haproxy (usually requires sudo or a dedicated polkit/sudoers rule).