kiss-proxy
node-http-proxy started
Continuing the legacy of an easy-to-use proxy server thatIt can be a real pain finding a dead-simple reverse proxy solution for node applications, what with nginx not being updated on some Linux distributions (and I don't even want to think about Windows), and node-http-proxy deciding that shipping a nice command-line utility like they used to was not a priority.
With that being said, I give you kiss-proxy, which has all the good mojo from the old original easy to use proxy, and is v0.10 compatible.
Install
npm install -g kiss-proxy
Using kiss-proxy from the command line
When you install this package with npm, a kiss-proxy binary will become available to you. Using this binary is easy with some simple options:
usage: kiss-proxy [options]
Starts a kiss-proxy server using the specified command-line options
options:
--port PORT Port that the proxy server should run on
--host HOST Host that the proxy server should run on
--target HOST:PORT Location of the server the proxy will target
--silent Silence the log output from the proxy server
--user USER User to drop privileges to once server socket is bound
--config OUTFILE Location of the JSON configuration file for the proxy
server. All above options may be specified in the config
file but will be overridden by command-line arguments
-h, --help You're staring at it
Here's an example of what the config file format could look like if you want to do vhost routing:
{
"router": {
"my-node-site.com": "http://127.0.0.1:24623",
"my-other-node-site.com": "http://127.0.0.1:13337",
"regex-works-(also|as well).com": {
"address": "http://127.0.0.1:13337",
"regex": true
}
},
"defaultRoute": "http://127.0.0.1:8020",
"silent": true,
"user": "cha0s"
}
Have fun, and happy devving! <3