I had good results using nodejitsu's node-http-proxy . As stated in their readme, they seem to support WebSockets.
Example for WebSockets (taken from their GitHub readme):
var http = require('http'), httpProxy = require('http-proxy'); // // Create an instance of node-http-proxy // var proxy = new httpProxy.HttpProxy(); var server = http.createServer(function (req, res) { // // Proxy normal HTTP requests // proxy.proxyRequest(req, res, { host: 'localhost', port: 8000 }) }); server.on('upgrade', function(req, socket, head) { // // Proxy websocket requests too // proxy.proxyWebSocketRequest(req, socket, head, { host: 'localhost', port: 8000 }); });
This usage should not be a problem as it is used for nodejitsu.com . To start a proxy application as a daemon, consider using forever .
source share