Created by: buschtoens
http-proxy finally supports unix socket paths. This closes this issue. You can now do stuff like this:
var httpProxy = require("http-proxy");
var options = {
hostnameOnly: true,
router: {
"mywebsite.com": "/tmp/node-http/mywebsite"
}
};
var proxyServer = httpProxy.createServer(options).listen(80);
I mainly altered the ProxyTable.getProxyLocation function. Before it tries to split the given target string into host
and port
it now looks for a leading slash which determines a socketPath
.
This commit is tested on normal routing like shown above. I haven't tested it on direct target
s and WebSockets
but it should work.