jesusprubio / shodan-client

:eyes: Node.js/JavaScript Library for accessing the new Shodan API
MIT License
198 stars 66 forks source link

async host(ip, key, opts) method returning an error: got.post : connect ECONNREFUSED 127.0.0.1:443 #42

Open madhav-vl opened 3 years ago

madhav-vl commented 3 years ago

Describe the bug

async host(ip, key, opts) method returning an error: Error: got.post : connect ECONNREFUSED 127.0.0.1:443

To Reproduce

Code snippet provided below

`exports.shodanScan = () => { const searchOpts = { history: false, minify: false, timeout: 40000 };

client
  .host('52.65.177.55', 'MY_API_KEY', searchOpts)
  .then(res => {
    console.log('Result:', res);
  })
  .catch(err => {
    console.log('Error:', err);
  });

} `

Expected behavior

Return all services that have been found on the given host IP.

Environment

Additional context

I'm able to get expected output using below service for the same IP and API_KEY https://api.shodan.io/shodan/host/{ip}?key={MY_API_KEY}