Skip to content


argument parsing problem? #19

DTrejo opened this Issue · 3 comments

2 participants


I just had this happen, dunno what to do. This could be a problem with optimist?

$ node-http-proxy --port 8000 --target localhost:8000 --target test.localhost:1234
The 'sys' module is now called 'util'. It should have a similar interface.

    throw e; // process.nextTick error, or 'error' event on first tick
TypeError: Object true,true has no method 'split'
    at Object. (/Users/david/local/lib/node/.npm/http-proxy/0.3.1/package/bin/node-http-proxy:52:31)
    at Module._compile (node.js:348:23)
    at Object..js (node.js:356:12)
    at Module.load (node.js:279:25)
    at loadModule (node.js:251:12)
    at require (node.js:291:14)
    at Object. (/Users/david/local/bin/node-http-proxy:11:18)
    at Module._compile (node.js:348:23)
    at Object..js (node.js:356:12)
    at Module.load (node.js:279:25)
nodejitsu member

You should be passing command line arguments like so: --argument=value:

$ node-http-proxy --port=8000 --target=test.localhost:1234
node-http-proxy server now listening on port: 8000

I'm also not sure why you have two --target statements. By specifying --port=8000 the proxy server will run at http://localhost:8000, so adding '--target=localhost:8000' is not necessary.

nodejitsu member

Update to CLI parsing in 34cba38 so that when --argument=value is not used, the help will be printed:

usage: node-http-proxy [options] 

All options should be set with the syntax --option=value

Thanks for correcting me :)

(I wasn't thinking clearly at that time, and was thinking I could just specify the routing table from the command line, which was wrong of me to think. I did figure everything out though.)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.