newman
newman copied to clipboard
Force dns.lookup for host that ends by localhost
- Newman Version (can be found via
newman -v
): 5.0.1 - OS details (type, version, and architecture): Debian 9 (in a Docker)
- Are you using Newman as a library, or via the CLI? library
- Did you encounter this recently, or has this bug always been there: this bug always been there
- Expected behaviour:
If I have another container under the same network as the container where Newman runs
And which host alias ends by localhost (eg. api.locahost) then if I use it as API base url
When I run the Postman collections in Newman with that base URL
Then it's not working because the URL is reachable
While now this is what happens:
Error: connect ECONNREFUSED 127.0.0.1:80 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 80
- Command / script used to run Newman: node myscript.js
- Sample collection, and auxiliary files (minus the sensitive details):
Example of environment file:
{ "id": "f4747b54-6e81-40ee-a7b3-bfd9c00dde51", "name": "DEV", "values": [ { "key": "api_base_url", "value": "http://api.localhost/", "enabled": true } ] }
Root cause of the problem is this: https://github.com/postmanlabs/postman-runtime/blob/develop/lib/requester/core.js#L270 which in my opinion should be configurable as an option.
Any news guys about this issue?