Running an app on Bluemix results in a tunneling socket error

147 Views Asked by At

I have added the proxy with an n.p.m installation. However, when I run my app locally it shows this error:

tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 80

What could be the problem? Is it that my added proxy is wrong or is there something else? If it is the former issue, please give me the steps to fix it. Thank you in advance.

2

There are 2 best solutions below

0
Dudi On

No need to add a proxy via npm installations. And it definately is the cause for your problem.

It is best to use the app.js provided that essentially acts a proxy for the browser requests to Bluemix

0
Dolev On

I understand you're trying to use the Tradeoff Analytics service. If all you need is a simple proxy, which does not do anything other than forward the \dilemma calls to the service, you might want to consider using the simplified proxy from the new UI's demo page. With this proxy, it's basically a two-liner to set-up a proxy.

To do that, please go to our GitHub project. Here are the steps you need to do in order to use the simple proxy:

  1. Add "http-proxy-middleware": "^0.9.0" to your package.json (this is the only dependency the simplified proxy needs).
  2. Copy the file tradeoff-analytics-proxy.js from our project.
  3. require it in your app.js - see line 20 in the sample app.js
  4. Run it - it will return an Express "middleware" you'll need to send to app.use() - see line 24.
  5. If you're using the Tradeoff Analytics UI Widget, you will need to change the dilemmaServiceUrl to /tradeoff-analytics-proxy/dilemmas. See line 16 of public/index.js.