mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #3057] [Feature] Expose the local address of a socket for request handling #1123
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#1123
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Tibso on GitHub (Jun 16, 2025).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/3057
Is your feature request related to a problem?
I would like to sort incoming requests based on the socket they originate from.
However, currently, there is no way to identify which socket a request is coming from.
As a result, I am forced to run multiple server instances, each with its own set of registered sockets, which is inefficient and cumbersome.
Describe the solution you'd like.
I'd like to expose sockets local addresses from
register_socket()andregister_listener()to inside theRequeststruct viahandle_raw_request()andhandle_request().With this change, we would be able for example to
request.socket_local_addrfrom insidehandle_request()orhandle_response(), and therefore be able to identify which socket the request came from.I have to look more into it because using the
Requeststruct for this doesn't make much sense.There must be a smarter way to do this.
There might also be a smarter/more efficient way to identify a socket than to keep a
SocketAddraround.I will be working on a PR in an attempt to add this functionality.
I'll try to add examples here using
Request, just to get an idea.In the meantime, I'd like to know what people think about this or if people have more insight about this.
@djc commented on GitHub (Jun 17, 2025):
What exactly about this is inefficient, and does it really need to be cumbersome?
@marcus0x62 commented on GitHub (Jun 26, 2025):
Why do you want to do this?