Socket closed error

Hello
I am using newman library with following code
i am getting error [errored] Socket closed

const newman = require(‘newman’);
const SocksProxyAgent = require(‘socks-proxy-agent’);
const requestAgent = new SocksProxyAgent({ host: ‘localhost’, port: ‘8080’ });

const pathtocheck = ‘/zapApiPostmanCollection.json’;
console.log(pathtocheck);
newman.run({
collection: pathtocheck,
requestAgents: {
http: requestAgent, // agent used for HTTP requests
https: requestAgent, // agent used for HTTPS requests
},
insecure:‘true’,
reporters: ‘cli’
},function (err) {
if (err) { throw err; }
console.log(‘collection run complete!’);

	});

Hi @sonawanesarvesh! Welcome to the community! :trophy: Let’s see if we can get you some help :slight_smile:

It may help to provide a bit more context and information on the issue you’re having. Can you please check out these guidelines on how to ask questions here on the forum? A clear question will go a long way to getting your problem solved, even just for readability’s sake.

@sean.keegan thank you for quick reply - i searched but i did not find any reference for the Socket Closed issue so thought to ask

my real problem is
i am getting Socket Closed error for following code
but this 0.0.0.0:8090 is used by other process easily so socket is open for sure

`const newman = require(‘newman’);
const SocksProxyAgent = require(‘socks-proxy-agent’);
const requestAgent = new SocksProxyAgent({ host: ‘0.0.0.0’, port: ‘8090’ });

const pathtocheck = ‘/zapApiPostmanCollection.json’;
console.log(pathtocheck);
newman.run({
collection: pathtocheck,
requestAgents: {
http: requestAgent, // agent used for HTTP requests
https: requestAgent, // agent used for HTTPS requests
},
insecure:‘true’,
reporters: ‘cli’
},function (err) {
if (err) { throw err; }
console.log(‘collection run complete!’);

Just update - i am running it inside Ubuntu Docker, thats why my proxy is running at 0.0.0.0:8090