[转帖]Difference between localhost and 127.0.0.1?
https://www.tutorialspoint.com/difference-between-localhost-and-127-0-0-1#:~:text=The%20most%20significant%20difference%20between,look%20up%20a%20table%20somewhere.
On almost every machine, the localhost and 127.0.0.1 are functionally the same. But, they are not exactly the same. This article is meant for explain the important differences between localhost and 127.0.01.
What is Localhost?
"localhost" is the machine name or IP address of the host server. You can think of it as the domain name for "127.0.0.1". The localhost allows a network connection to loop back on itself. It is a communication port that is connected to the local server. It helps us in spoofing the network connections when such a network does not exist. We tend to use localhost as the synonym for "127.0.0.1", however, in actual practice, they are not exactly the same.
When you type "localhost" in your browser's address bar, the browser looks up for its associated IP address. Note that "localhost" needn't always resolve to "127.0.0.1". It may redirect to another IP address within the loopback block of addresses.
What is 127.0.0.1?
The IP address 127.0.0.1 is one of the most commonly used loopback IP addresses. 127.0.0.1 is used specifically for loopback functionality. 127.0.0.1 is a part of a reserved block of more than sixteen million IP addresses. 127.0.0.1 is a private IP address that is used to connect with the same device on which the address was entered.
You will be using this IP address frequently while developing web applications because when you type "127.0.0.1" in the address bar of your browser, it will load the local web server's page. In addition, one can use 127.0.0.1 to access the network services running on the local machine.
Differences between Localhost and 127.0.0.1
The following table highlights all the important differences between localhost and 127.0.0.1 −
| Localhost | 127.0.0.1 |
|---|---|
| In localhost, we need a lookup table. | There is no need of a lookup table. |
| The conversion of localhost into IP address requires a look up table. | The address 127.0.0.1 can be converted into an IP address directly with the help of intelligent software. In this, there is no need to do look up table at all. |
| The localhost is easy to remember. | It is hard to remember the IP address 127.0.0.1. |
| It is user-friendly in the sense that all you need to type is "http://localhost" in the address bar of your browser. | One needs to type "http://127.0.0.1" in the address bar of the browser, which is comparatively a little difficult to remember. |
| The localhost is slower as compared to 127.0.0.1. | The IP address 127.0.0.1 is faster |
Conclusion
The most significant difference between localhost and 127.0.0.1 is that there is a need to have a lookup table in case of localhost, while in 127.0.0.1, we do not need to look up a table somewhere.
[转帖]Difference between localhost and 127.0.0.1?的更多相关文章
- [转帖]localhost与127.0.0.1的区别
localhost与127.0.0.1的区别 https://www.cnblogs.com/hqbhonker/p/3449975.html 前段时间用PG的时候总有问题 当时没有考虑 localh ...
- 0.0.0.0 IPAddress.Any 【】127.0.0.1 IPAddress.Loopback 【】localhost
0.0.0.0 IPAddress.Any https://msdn.microsoft.com/en-us/library/system.net.ipaddress.any(v=vs.110).a ...
- localhost与127.0.0.1的区别
localhost与127.0.0.1的区别是什么 定义 localhost也叫local ,正确的解释是:本地服务 127.0.0.1在windows等系统的正确解释是:本机地址(本机服务器) 不同 ...
- fiddler监听127.0.0.1或localhost
localhost/127.0.0.1的请求不会通过任何代理发送,fiddler也就无法截获. 解决方案 1,用 http://localhost. (locahost紧跟一个点号)2,用 http: ...
- android异常: java.net.ConnectException: localhost/127.0.0.1:8080 - Connection refused
android手机做下载文件时,报了如下异常: java.net.ConnectException: localhost/127.0.0.1:8080 - Connection refused 模拟器 ...
- 如果觉得配置文件没有错,但web-dev-server总是报错,可以在hosts文件里加一行127.0.0.1 localhost
如果觉得配置文件没有错,但web-dev-server总是报错,可以在hosts文件里加一行127.0.0.1 localhost
- linux下使用localhost和127.0.0.1都不能连接的解决思路
linux下刚安装了mysql,尝试写了程序连接mysql,出现了只有用本地ip地址才能连接,而127.0.0.1和localhost都不能访问 解决这个问题主要查看3个方向 .hosts中是否有ip ...
- [转载]localhost与127.0.0.1的区别
原文链接:http://blog.csdn.net/xifeijian/article/details/12879395 很多人会接触到这个ip地址127.0.0.1.也许你会问127.0.0.1是什 ...
- Tomcat在局域网中localhost可以访问,但是无法通过本地ip访问,127.0.0.1也无法访问问题的解决方法
环境:Tomcat6,Windows Server2008 R2, Tomcat使用默认端口8080. 在BO服务器上使用Tomcat6作为WEB服务器,在服务器本地使用http://localhos ...
- MySQL主机127.0.0.1与localhost区别总结
1. mysql -h 127.0.0.1 的时候,使用TCP/IP连接, mysql server 认为该连接来自于127.0.0.1或者是"localhost.localdomain&q ...
随机推荐
- Python——第一章:占位——pass
pass: 常用于代码占位 a = 10 if a > 100: pass 当设计代码时,有些条件或代码还没有想好要如何处理,先用pass做占位,后续可以回来继续写.如果不写pass则会报错,因 ...
- Android学习--ListView和Tab
产生一个ListView 其中包含很多items,第一个item启动另一个实现了Tab的Activity. 关于tab的使用方式,参见下面blog http://oldshark.blog.163.c ...
- LeetCode 递归篇(70、22、98、104)
70. 爬楼梯 假设你正在爬楼梯.需要 n 阶你才能到达楼顶. 每次你可以爬 1 或 2 个台阶.你有多少种不同的方法可以爬到楼顶呢? 注意:给定 n 是一个正整数. 示例 1: 输入: 2 输出: ...
- 面试官:String长度有限制吗?是多少?还好我看过
前言 话说Java中String是有长度限制的,听到这里很多人不禁要问,String还有长度限制?是的有,而且在JVM编译中还有规范,而且有的家人们在面试的时候也遇到了,本人就遇到过面试的时候问这个的 ...
- 解析Stream foreach源码
摘要:串行流比较简单,对于parallelStream,站在它背后的是ForkJoin框架. 本文分享自华为云社区<深入理解Stream之foreach源码解析>,作者:李哥技术 . 前言 ...
- 二进制SCA指纹提取黑科技:Go语言逆向技术
摘要:SCA(Software Composition Analysis)软件成分分析,指通过对软件源码.二进制软件包等的静态分析,挖掘其所存在的开源合规.已知漏洞等安全合规风险,是一种业界常见的安全 ...
- 实例讲解将Graph Explorer搬上JupyterLab
摘要:基于 Graph Explorer 在 Jupyter 上进行图探索,可以大大降低编码成本,丰富 JupyterLab 的数据表现力. 本文分享自华为云社区<将 Graph Explore ...
- CWE 视图层级关系解析:节点关系查询
本文分享自华为云社区<CWE视图层级关系的解析 之 CWE节点关系的查询>,作者: Uncle_Tom. 1. CWE 转换成 SQLite 表 依据<CWE视图层级关系的解析 之 ...
- IaaS首席架构师的架构设计思考与实践
摘要:本文分享了华为云Stack IaaS的设计思考与实践,基于公有云先进的架构技术和创新能力,采用重构改造+积木式搭配+抽屉式替换等方式,健康的.可持续的为客户不断的提供产品和服务. 本文分享自华为 ...
- 火山引擎入选《2022 爱分析 · DataOps 厂商全景报告》,旗下 DataLeap 产品能力获认可
更多技术交流.求职机会,欢迎关注字节跳动数据平台微信公众号,回复[1]进入官方交流群 2 月 9 日,国内领先的数字化市场研究与咨询机构爱分析发布了<2022 爱分析·DataOps 厂商全景报 ...