mirror of
https://github.com/nmap/nmap.git
synced 2025-12-23 07:59:03 +00:00
Let http.lua functions optionally connect via any address family
Sometimes (e.g. when using an external API), a script wants to connect by name to a server and doesn't care whether IPv4 or IPv6 is used. By passing the "any_af" option, the first resolved address of any address family will be used, allowing external-category scripts which used to fail with -6 to succeed.
This commit is contained in:
@@ -163,7 +163,7 @@ local function check_domain (domain)
|
||||
|
||||
stdnse.print_debug(1, "Checking availability of domain %s with tld:%s ", name, tld)
|
||||
local path = string.format("/all/%s?/tlds=%s&limit=1", name, tld)
|
||||
local response = http.get("instantdomainsearch.com", 443, path)
|
||||
local response = http.get("instantdomainsearch.com", 443, path, {any_af=true})
|
||||
if ( not(response) or (response.status and response.status ~= 200) ) then
|
||||
return nil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user