2

I am getting the below error while trying to run Mocha JS test case which runs npm request-promise to call a REST service. I was able to connect to the REST URI endpoint through ARC client bur it failed with below error while running through organization's proxy-

     RequestError: Error: connect ETIMEDOUT SERVER_IP:SERVER_PORT
  at new RequestError (<Some_Path>\errors.js:14:15)
  at Request.plumbing.callback (<Some_Path>\plumbing.js:87:29)
  at Request.RP$callback [as _callback] (<Some_Path>\plumbing.js:46:31)
  at self.callback (<Some_Path>\request.js:188:22)
  at Request.onRequestError (<Some_Path>\request\request.js:884:8)
  at TLSSocket.socketErrorListener (_http_client.js:309:9)
  at emitErrorNT (net.js:1277:8)
  at _combinedTickCallback (internal/process/next_tick.js:80:11)
  at process._tickCallback (internal/process/next_tick.js:104:9)
Kunal Patil
  • 745
  • 1
  • 9
  • 18

2 Answers2

4

I fixed this issue with adding the following in the request-promise options-

proxy:'http://PROXY_SERVER_IP:PORT#'

I hope this helps.

Cheers, Kunal

Kunal Patil
  • 745
  • 1
  • 9
  • 18
  • Could you please clarify where do you add it and how you do ? – Ahmed Ibrahim Jul 04 '17 at 23:08
  • @AhmedIbrahim I added it to the `options` while calling the REST service using request-promise as below:let options = `{ method: 'POST', uri: , json: true, headers: { }, body : , proxy:'http://' };` – Kunal Patil Jul 06 '17 at 10:53
0

This worked for me

var request = require('request-promise').defaults({ proxy:'http://username:password@host:port', strictSSL :false });