Skip to content

Commit

Permalink
feat(http): add an option nameservers to query dns
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
  • Loading branch information
zhaojh329 committed Mar 19, 2024
1 parent d3747b9 commit d2ec6a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion http/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ function methods:request(method, url, body, opts)
local answers, err = dns.query(host, {
type = opts.ipv6 and dns.TYPE_AAAA or dns.TYPE_A,
mark = opts.mark,
device = opts.device
device = opts.device,
nameservers = opts.nameservers
})
if not answers then
return nil, 'resolve "' .. host .. '" fail: ' .. err
Expand Down Expand Up @@ -432,6 +433,7 @@ end
body_to_file: A string indicates that the body is to be written to the file.
mark: a number used to set SO_MARK to socket
device: a string used to set SO_BINDTODEVICE to socket
nameservers: see dns.query
In case of failure, the function returns nil followed by an error message.
If successful, returns a table contains the
Expand Down

0 comments on commit d2ec6a3

Please sign in to comment.