[转帖]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 ...
随机推荐
- CF1340F Nastya and CBS 题解
题目大意 给定一个长度为 \(n(n \le 10 ^ 5)\) 的括号序列.要求支持两个操作: 修改某个位置的括号. 询问 \([l, r]\) 区间内的括号序列是否合法. 题目分析 显然,这道题是 ...
- Reactor 简介
官方的介绍如下: Reactor is a fully non-blocking reactive programming foundation for the JVM, with efficient ...
- 一文了解Vprix容器流媒体平台和传统云桌面的区别、优劣势
在当今数字化时代,随着云计算和远程办公的兴起,云桌面项目成为了提升工作效率和灵活性的重要工具.云桌面项目通过将用户的桌面环境和应用程序虚拟化,为用户提供了随时随地访问个人工作环境的便利.本文将介绍Vp ...
- 使用IO流写一个随机点名程序
前言 最近学习了关于IO流的一些知识点,但是应用还不够,所以今天做个简单案例: 随机创建名字导入文件中: package ioandcollection; import java.io.Buffere ...
- C#数据结构与算法系列(十七):时间复杂度(下)
1.常见的时间复杂度 常数阶:O(1) 对数阶:O(log2n) 线性阶:O(n) 线性对数阶:O(nlog2n) 平方阶:O(n^2) 立方阶:O(n^3) k次方阶:O(2^n) 常见的算法时间复 ...
- 如何使用ffmpeg转换图片格式
ffmpeg简介与图片格式介绍 windows安装ffmpeg,从如下网站下载release版本 https://www.gyan.dev/ffmpeg/builds/ ffmpeg 6.1版本仍然不 ...
- BM25(Best Matching 25)算法基本思想
BM25(Best Matching 25)是一种用于信息检索(Information Retrieval)和文本挖掘的算法,它被广泛应用于搜索引擎和相关领域.BM25 基于 TF-IDF(Ter ...
- 详解MRS HBase全局二级索引
本文分享自华为云社区<MRS HBase全局二级索引原理与使用场景>,作者:学习一下大数据 . 一.HBase二级索引背景介绍 HBase是基于Key-Value的分布式存储数据库,对表中 ...
- 先收藏!关于Java类、接口、枚举的知识点大汇总
摘要:Java知识点精选之类.接口.枚举30问,算是比较基础的,希望大家一起学习进步. 整理了一些JAVA语言的在类.接口.枚举等方面的知识点以及大家常遇到的问题.希望能帮助到大家. Q: 各修饰符所 ...
- 云图说丨什么是应用身份管理服务OneAccess
摘要: OneAccess是华为云提供的应用身份管理服务,具备集中式的身份管理.认证和授权能力,保证企业用户根据权限访问受信任的云端和本地应用系统,并对异常访问行为进行有效防范,真正做到事前预防.事中 ...