newman icon indicating copy to clipboard operation
newman copied to clipboard

Force dns.lookup for host that ends by localhost

Open aurelienlair opened this issue 4 years ago • 1 comments

  1. Newman Version (can be found via newman -v): 5.0.1
  2. OS details (type, version, and architecture): Debian 9 (in a Docker)
  3. Are you using Newman as a library, or via the CLI? library
  4. Did you encounter this recently, or has this bug always been there: this bug always been there
  5. 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
  6. Command / script used to run Newman: node myscript.js
  7. 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.

aurelienlair avatar Jul 02 '20 12:07 aurelienlair

Any news guys about this issue?

aurelienlair avatar Oct 18 '21 20:10 aurelienlair