Change the return type of IP.resolve_hostname()
to return an array of IPs instead of a single String
#2501
Labels
Milestone
Describe the project you are working on
Testing my proxy implementation for Godot
Describe the problem or limitation you are having in your project
When trying to connect
HTTPClient
tolocalhost
, it fails because the hostname is resolved into an IPv6 address, and the server is listening on an IPv4 address.The current API,
IP.resolve_hostname()
andIP.get_resolve_item_address()
, only resolves hostname into a single IP address. This is the root cause of my issue and issues like godotengine/godot#36418. This also makes it hard to utilize DNS load balancing.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Change the return type of
IP.resolve_hostname()
andIP.get_resolve_item_address()
fromString
toArray
, and return all the resolved IP addresses.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I made a test implementation at https://github.com/timothyqiu/godot/tree/dns-resolve
After this is implemented, we are then possible to resolve the dual-stack issue.
For backward compatibility, components that depends on the current API can use the first record in the array. (For 3.x, we can even keep the original API, only resolve to multiple IPs internally, so some issues can be resolved for classes like
HTTPClient
.)If this enhancement will not be used often, can it be worked around with a few lines of script?
Seems impossible.
Is there a reason why this should be core and not an add-on in the asset library?
Seems impossible.
The text was updated successfully, but these errors were encountered: