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

proxy-router

v1.2.7

Published

NodeJS dynamic router for http-proxy. Handle requests to Apache, Nginx, NodeJS, and other server on port 80.

Downloads

10

Readme

NodeJS Proxy Router CLI

Small proxy router to route all requests to port 80 by proxying to another hosts and ports. Run NodeJS, Apache, Nginx, etc together in single server.


Instalation

Before installing Proxy Router, ensure you have NodeJS, NPM, and Forever installed in your machine.

Also if you registering NodeJS app to Proxy Router, be carefull since we using forever -w start YOURAPP. So if your app doing grunt or any action that changing files during runtime inside your app folder, we will restart your app. Add ignore list to file .foreverignore in your app folder to avoid forever watching your changed files during runtime.

Proxy Router currently supported on Mac and Linux machine (who have /etc/hosts file).

$ npm install -g proxy-router

Usage

Please note, you must always run the Proxy Router with root priverllage (sudo). We need it to edit the /etc/hosts file.

$ sudo proxy-router COMMAND

Available Commands

  • start - Start Proxy Router and all registered NodeJS hosts.
  • stop - Stop Proxy Router and all registered NodeJS hosts.
  • restart - Restart Proxy Router.
  • list - List all register hosts with Proxy Router.
  • add - Register new NodeJS hosts or another hosts (Apache, Nginx, etc) to Proxy Router
  • delete - Delete NodeJS hosts or another hosts (Apache, Nginx, etc) from Proxy Router
  • delete-all - Delete all registered hosts from Proxy Router

When registering hosts, you will be asked for few infos:

  • Server Type - The server that run your host. If your host is NodeJS app, we will start it after adding host.
  • Protocol - The protocol of your host. http or https
  • Host Name - The host name of your app. E.g dev.app.local
  • Target Host - The original host of your app (without http/https) where your app will be routed from. E.g node-app.com. Default is localhost (127.0.0.1)
  • Port - The port of app run on. If your host is NodeJS app, we will use this port to start your app --port=PORT.
  • Location - NodeJS Choice - Location of your NodeJS app. By default is the path where you run the Proxy Router
  • Server Starter - NodeJS Choice - File name to start your app. Default is index.js
  • Additional Arguments - NodeJS Choice - Add custom arguments to start your app. E.g --prod --safe

Example

Add new host with NodeJS app.

macbook:test-app euser$ sudo proxy-router add

? Server Type: (Use arrow keys)
❯ ⦿ NodeJS 
  ⦿ Apache, Nginx, Etc 
? Protocol: (Use arrow keys)
❯ ⦿ http 
  ⦿ https 
? Host Name: test
? Target Host: (127.0.0.1) 
? Port: (8001) 
? Location: (/Users/euser/node-apps/test-app) 
? Server Starter: (index.js) 
? Additional Arguments. Separated by space. --dev --safe

After test host added, Proxy Router will also start the test-app including the arguments. Start command will be forever -w start index.js --dev --safe --port=8001