Skip to content

Commit

Permalink
feat(http): add an option device to set SO_BINDTODEVICE
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <[email protected]>
  • Loading branch information
zhaojh329 committed Mar 19, 2024
1 parent 13b0ff1 commit d3747b9
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 @@ -360,7 +360,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
mark = opts.mark,
device = opts.device
})
if not answers then
return nil, 'resolve "' .. host .. '" fail: ' .. err
Expand Down Expand Up @@ -430,6 +431,7 @@ end
ipv6: A boolean, parse ipv6 address for host.
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
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 d3747b9

Please sign in to comment.