JusticeTech System 〽️
Open in Telegram
Learn to learn before you teach
Show moreThe country is not specifiedThe category is not specified
233
Subscribers
+124 hours
-27 days
-130 days
Posts Archive
A Conclusive Analogy
Imagine your phone is a company building.
Inside it are different departments:
Browser
Web server
Database
File storage
Normally, if one company wants to contact another, it uses the internet.
But if two departments in the same building need to communicate, they just walk down the hallway.
localhost is that hallway, it lets programs on the same device talk to each other without going out to the internet.
09 Aug, 08:17
Why is localhost so useful?
Imagine every time you wrote code, you had to upload it to a web hosting service before seeing your changes.
Instead, you run "npx serve" or another development server, and immediately open "localhost:3000"
Now you can:
edit your code,
refresh the page,
instantly see the changes.
That's the essence of localhost.
09 Aug, 08:15
Stage 3
Suppose you started:
npx serve and that program opened Port 3000.
The operating system says:
The program serve is listening there.
The browser sends GET / to that local server.
Then the server replies with:
index.html
CSS
JavaScript
Images
Your browser then displays the webpage.
Notice that nothing needed to travel across the internet. Everything happened on your own device.
09 Aug, 08:12
Stage 2
Now that the browser now knows the address:
127.0.0.1
Next it question is:
Who is listening on Port 3000?
09 Aug, 08:09
What actually happened when you type http://localhost:3000
Stage 1
Your browser asks:
What is localhost?
The operating system replies:
localhost means 127.0.0.1.
09 Aug, 08:08
What happens when you type:
http://localhost:3000
A debate will automatically set up between your browser and your device operating system
09 Aug, 08:06
Fourth interpretation means
Connect to my own device using Port 3000.
I have already taught you port so you should understand
09 Aug, 08:04
I know you have a question base on what you have been seeing
This http://localhost:3000 is thesame as http://127.0.0.1:3000
How do i know? 😂 😂
09 Aug, 08:03
They convert "localhost" into a special IP address.
For IPv4:
127.0.0.1
09 Aug, 08:01
localhost has an IP Address
Computers don't actually understand the word localhost
I got you there right 😄😄
Now how will the computer sort this out
09 Aug, 07:59
Now that you know the definition of localhost
It will interest you to know that there's a weird thing that always happen behind the scene let's check it out...
09 Aug, 07:56
Hostname vs IP Address
IP address identifies where a device is on a network.
Hostname gives that device a readable name.
You can think of it like:
IP address = house address
Hostname = person's name
09 Aug, 07:52
Now how do we differentiate IP address and Hostname
If you have been closely following my teachings you would want to ask this question
So let me explain
09 Aug, 07:51
Similarly, instead of identifying a computer only by its IP address e.g 192.168.1.25
it can have a hostname such as "justice-phone"
So:
Hostname: justice-phone
IP address : 192.168.1.25
09 Aug, 07:50
What Is a Hostname?
A hostname is simply a human-readable name given to a device on a network.
Think of it as the name of a computer, phone, or server.
Imagine a school has 500 students.
Instead of saying, Hey, student number 384!
You might say, Hey, Daniel!
Daniel is a name that is easier for humans to recognize.
09 Aug, 07:48
Let me quickly bring some lights into this matter of hostname.....
09 Aug, 07:46
