Optimization of IP address acquisition method #6160
Labels
area/Client
Related to Nacos Client SDK
kind/enhancement
Category issues or prs related to enhancement.
Milestone
Is your feature request related to a problem? Please describe.
Currently, in the
NetUtils.localIP()
method, the IP address is set by specifying thecom.alibaba.nacos.client.naming.local.ip
parameter. However, theNetUtils.localIP()
method is used in the config module and naming module, even in the connection layer. Therefore, I think this parameter name is unsuitable. In addition, if you want to use the hostname instead of IP for config publishing, it is not very convenient at present. You need to specify thecom.alibaba.nacos.client.naming.local.ip
parameter as the hostname, not automatic discovery.Describe the solution you'd like
I think the
com.alibaba.nacos.client.naming.local.ip
parameter should be changed tocom.alibaba.nacos.client.local.ip
, and acom.alibaba.nacos.client.preferHostname
parameter should be provided to specify that IP is preferred to be replaced by hostname for config publishing. If you agree with this, I can provide PR.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: