localhost与127.0.0.1的区别
时间:2020-02-07 10:42:24
收藏:0
阅读:49
1. localhost是本地服务器,127.0.0.1是本机服务器,他们的解析是通过本机的host文件,windows自动将localhost解析为127.0.0.1;
2. localhost是不经过网卡传输,它不受网络防火墙和网卡相关的设置,而127.0.0.1或本机IP是通过网卡传输的,它受到网络防火墙和网卡相关的限制;
3. 127.0.0.1只能通过本机访问,而本机IP可以通过本机访问,也可以外部访问;
4. 一般设置程序时,本地服务用localhost是最好的,localhost不会解析为ip,也不会占用网卡和网络资源。
原文:https://www.cnblogs.com/ruhuanxingyun/p/12271936.html
评论(0)