We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
s/Server.go 通过addrs, _ := net.InterfaceAddrs()获取的ip为:addrs, _ := net.InterfaceAddrs() 得到结果: [fe80::150d:b4b3:cf2c:2d02/64 169.254.45.2/16 192.168.137.1/24 fe80::fd3d:1ddd:40b2:f6fc/64 169.254.246.252/16 fe80::a4cf:b26f:e2ec:3c15/64 169.254.60.21/16 fe80::7982:86dd:4f4:c5b4/64 10.59.6.79/20 fe80::a925:65ee:23ec:24 9a/64 10.51.12.165/24 ::1/128 127.0.0.1/8 fe80::5efe:a33:ca5/128] 通过以下代码段获取到ip地址: if an.IP.IsGlobalUnicast() && !strings.HasPrefix(an.IP.To4().String(), "172.17.") { ip = an.IP.To4() break } 得到192.168.137.1,这个ip提供的server是无法访问的 实际可用的ip 10.51.12.165
The text was updated successfully, but these errors were encountered:
No branches or pull requests
s/Server.go
通过addrs, _ := net.InterfaceAddrs()获取的ip为:addrs, _ := net.InterfaceAddrs()
得到结果:
[fe80::150d:b4b3:cf2c:2d02/64 169.254.45.2/16 192.168.137.1/24 fe80::fd3d:1ddd:40b2:f6fc/64 169.254.246.252/16 fe80::a4cf:b26f:e2ec:3c15/64 169.254.60.21/16 fe80::7982:86dd:4f4:c5b4/64 10.59.6.79/20 fe80::a925:65ee:23ec:24
9a/64 10.51.12.165/24 ::1/128 127.0.0.1/8 fe80::5efe:a33:ca5/128]
通过以下代码段获取到ip地址:
if an.IP.IsGlobalUnicast() && !strings.HasPrefix(an.IP.To4().String(), "172.17.") {
ip = an.IP.To4()
break
}
得到192.168.137.1,这个ip提供的server是无法访问的
实际可用的ip 10.51.12.165
The text was updated successfully, but these errors were encountered: