kevinohara80 / nforce

nforce is a node.js salesforce REST API wrapper for force.com, database.com, and salesforce.com
MIT License
474 stars 167 forks source link

Behind Corporate Proxy #93

Closed krprasadreddy closed 9 years ago

krprasadreddy commented 9 years ago

I'm not able to authenticate with Salesforce as it refuses to connect. I'm behind my corporate proxy.How do I set my proxy to bypass it ?

krprasadreddy commented 9 years ago

This is the message : Error: connect ECONNREFUSED

kevinohara80 commented 9 years ago

Ok, I've been meaning to do this for a while and I just released it in 1.2.0...

I've added the ability to pass additional parameters down to the underlying request module. In request, you can specify a proxy. So in the nforce request, just define a requestOpts hash with the proxy info...

org.query({ 
  oauth: oauth, 
  query: 'SELECT .... FROM Account',
  requestOpts: {
    proxy: {...}
  }
})

I don't have a proxy to test with so give it a shot and let me know.

More info on proxying in request can be found here