Closed
Description
I'd like to set up a proxy server like so:
var httpProxy = require('http-proxy');
var port = process.env.PORT || 9876;
var proxiedHost = process.env.PROXIEDHOST || '127.0.0.1';
var proxiedPort = process.env.PROXIEDPORT || 8765;
httpProxy.createServer(proxiedPort, proxiedHost).listen(port);
If I set an environment variable for PORT I'm fine but doing the same for PROXIEDPORT breaks things because it expects a number instead of a string. Looks like node handles this in the net library with a handy toNumber function.
(Also, as an aside, it would be nice if the proxied host defaulted to 127.0.0.1 when missing that parameter.)
Metadata
Metadata
Assignees
Labels
No labels