Extensions for Nodejitsu's node-http-proxy library.
Satellite uses Nodejitsu's node-http-proxy to help with:
And in the future...
npm install satellite
Let's say you have an application which has multiple instances running on different servers, and you want to setup a proxy server to load-balance requests across those servers.
Satellite provides a round-robin strategy that you can apply to your existing proxy server code:
// This example demonstrates proxying requests between// 2 serversvar httpProxy = ;var satellite = ;// Add 2 different servers to the proxy listsatellite;satellite;var proxyServer = httpProxy;
Your proxy server will now distribute requests to the servers in a round-robin fashion.
Some application setups require sticky-session support.
For more info on sticky sessions and why you would use them, see the explanation provided in the Readme on SockJS' github repository.
To enable sticky session support in your proxy server, you can do this:
// This example demonstrates using sticky session// supportvar httpProxy = ;var satellite = ;// Add 2 different servers to the proxy listsatellite;satellite;var proxyServer = httpProxy;
NOTE: If you wish to use both round-robin and sticky-session support in your application, make sure that you call the sticky-session middleware after you have called the round-robin middleware, like this:
var proxyServer = httpProxy
At the moment, there is a Redis store option in active development (in order to support use of Node.js's cluster API with satellite). There is a hanging request issue which I am yet to resolve, so I will keep working at this until it is fixed.
Satellite was built against Node.js v0.6.17, and has it's engine set against that version.
It may be able to run on previous versions of Node.js, but you'll need to git clone a copy and modify the package.json to do so.
Because there is also a Redis store in development, Redis is an optional dependency.
© 2013 Anephenix Ltd.