This is a Proxy Server for Node.js submitted as the pre-work requirement for CodePath.
Time spent: [1hr]
8000
are echoed back with the same HTTP headers and body--host
, --port
or --url
argumentsx-destination-url
header--logfile
argument outputs all logs to the file specified instead of stdout--exec
argument proxies stdin/stdout to/from the destination program--loglevel
argument sets the logging chattiness-h
argument prints CLI APIFor help. run
babel-node index.js -h
//do a npm install first
npm start
curl -v http://127.0.0.1:8001 -H 'x-cat:niuniu'
nodemon -x babel-node index --url http://google.com
curl -v http://127.0.0.1:8001 -H 'x-cat:niuniu'
nodemon -x babel-node index --host google.com --port 80
curl -v http://127.0.0.1:8001 -H 'x-cat:niuniu'
babel-node index
curl -v http://127.0.0.1:8001 -H 'x-cat:niuniu'
curl -v http://127.0.0.1:8001 -H 'x-destination-url:http://google.com'
babel-node index --mylog=/tmp/codepath-proxy.log
curl -v http://127.0.0.1:8001 -H 'x-destination-url:http://google.com'