[转帖]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 ...
随机推荐
- 记一次windows病毒联合排查全过程
8月2日通过态势感知平台,发现大量内部DNS服务器有恶意请求,且告警描述为:试图解析僵尸网络C&C服务器xmr-eu2.nanopool.org的地址,通过截图可以看到,用户每5分钟会定期向目 ...
- zabbix+oracle环境部署
oracle11安装完成后, 实例名: zbx01 oracle创建zbx01用户:col file_name for a60;set linesize 160;select file_name,ta ...
- 扩展中国剩余定理(Excrt)笔记
扩展中国剩余定理(excrt) 本来应该先学中国剩余定理的.但是有了扩展中国剩余定理,朴素的 CRT 就没用了. 扩展中国剩余定理用来求解如下形式的同余方程组: \[\begin{cases} x \ ...
- (Dnc系列)借助Dnc.Events.InMemory在三分钟实现一个内存级别的事件驱动处理模型
前言 Dnc.Events是在借鉴领域驱动设计大佬daxnet的博客基础上做的基于内存级别的EDA处理模型,不清楚EDA的童鞋请自行百度. 第一分钟 安装Nuget Dnc.Events.InMemo ...
- 连Python都不熟也能跑通AI人脸识别?“隐藏Boss”竟是它!
摘要:先把AI人脸识别跑起来,然后研究它是如何实现的,整个过程中确实收获不少.所谓先跟着做,再跟着学,实践与理论结合,自己感觉有理解了一些基础概念入个门,在此分享一下自己的捣鼓经验. 1.买台小&qu ...
- 不信谣不传谣,亲自动手验证ModelBox推理是否真的“高性能”
摘要:"高性能推理"是ModelBox宣传的主要特性之一,不信谣不传谣的我决定通过原生API和ModelBox实现相同案例进行对比,看一下ModelBox推理是否真的"高 ...
- 火出边际的Serverless,你居然还不了解?
摘要:图灵奖获得者David A. Patterson和Spark共同创始人Ion Stoica,在19年伯克利的会议上发布Serverless将是下一代默认的计算范式. 本文分享自华为云社区< ...
- iOS App Store上架流程详解
很多开发者在开发完iOS APP.进行内测后,下一步就面临上架App Store,不过也有很多同学对APP上架App Store的流程不太了解,下面我们来说一下iOS APP上架App Store ...
- 性能提升-如何设置Windows操作系统TIME_WAIT状态的TCP连接快速回收时间?
大规模Windows环境下,采用Nginx反向代理服务后,操作系统会产生较多TIME_WAIT的TCP(Transmission Control Protocol)连接,操作系统默认TIME_WAIT ...
- 解密Prompt系列23.大模型幻觉分类&归因&检测&缓解方案脑图全梳理
上一章我们主要聊聊RAG场景下的幻觉检测和解决方案,这一章我们单独针对大模型的幻觉问题,从幻觉类型,幻觉来源,幻觉检测,幻觉缓解这四个方向进行整理.这里就不细说任意一种方法了,因为说不完根本说不完,索 ...