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.
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
$ npm install -g proxy-router
Please note, you must always run the Proxy Router with root priverllage (sudo). We need it to edit the
$ sudo proxy-router COMMAND
- 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.
- Host Name - The host name of your app. E.g
- 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
- 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
- Additional Arguments - NodeJS Choice - Add custom arguments to start your app. E.g
Add new host with NodeJS app.
macbook:test-app euser$ sudo proxy-router add? Server Type:❯ ⦿ NodeJS⦿ Apache, Nginx, Etc? Protocol:❯ ⦿ http⦿ https? Host Name: test? Target Host:? Port:? Location:? Server Starter:? Additional Arguments. Separated by space. --dev --safe
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