ECONNRESET error with Node.js proxy on Private cloud deployment

Not applicable

We're experiencing the following error running this proxy on an Edge Private Cloud deployment. This node.js proxy appears to run fine in the Apigee Cloud instance without issue. Is there a difference in the node versions or node packages that are supported in both deployments? Or is there another network related issue that should be investigated?

Would really appreciate some assistance here.

var express = require('express');
var request = require('request');
var app = express();
 
var openam_url = 'http://<hostname>:8080/openam/json/authenticate';
app.post('/test', function(http_req, http_res, next) {
  console.log(http_req.headers);
     request.post({url:openam_url,
    headers:{
      connection: 'keep-alive',
      "Content-Type":'application/json'
    }
   }, function(lErr, lRes, lBody) {
            if (lErr || lRes.statusCode >= 400) {
 
              console.log(lErr);
              console.log("From the app.")
 
              lErr['addtional_message'] = "Test Message";
   
              http_res.send({
              'status': 'error',
              'message': lBody,
                         'Error': lErr
 
            });
              return;
            }
            console.log("From the app.")
            //inspect(lBody,"Logout Body");
            http_res.send({
              'status': 'success',
              'message': lBody
            });
          });
});
app.listen(3000, function() {});
{
  "status": "error",
  "Error": {
    "message": "socket hang up",
    "code": "ECONNRESET",
    "addtional_message": "Test Message"
  }
}
Solved Solved
0 2 5,396
1 ACCEPTED SOLUTION

Not applicable

The issue was due to the nodejs.properties file in the MP config having an entry that denied connections to private IP address ranges. After commenting out the entry in the config 'source' directory, the problem resolved itself.

View solution in original post

2 REPLIES 2

Not applicable

The issue was due to the nodejs.properties file in the MP config having an entry that denied connections to private IP address ranges. After commenting out the entry in the config 'source' directory, the problem resolved itself.