mikeal / node.couchapp.js

Utility for writing couchapps.
Apache License 2.0
406 stars 78 forks source link

let it work behind a proxy #35

Open avalez opened 12 years ago

avalez commented 12 years ago

I cannot reach the remote server directly from my network and need to go through a proxy.

It appears request/main.js has support for proxy, but I've not managed to make it work without a patch.

One way would be to pass proxy in options, and let it specify in command line arguments, but I found it better to let request/main.js use http_proxy/https_proxy enviroment variable:

Index: node_modules/couchapp/node_modules/request/main.js

--- node_modules/couchapp/node_modules/request/main.js (revision 117) +++ node_modules/couchapp/node_modules/request/main.js (working copy) @@ -104,6 +104,10 @@ if (options.proxy) { if (typeof options.proxy == 'string') options.proxy = url.parse(options.proxy) }

Hope you'll find it useful, or please let me know if there is better solution.

TODO: mention this in documentation.

Thank you.