🌐Localhost
Also known as 127.0.0.1, Loopback Address, Loopback Interface
The name a computer uses for itself. Traffic sent there never leaves the machine.
Think of it like
It is like writing a note to yourself. It never leaves your own desk.
Example
Emma runs her new site on her laptop. She opens localhost:3000 in her browser to see it, and nobody else can.
Why it matters
It lets you build and test in private. It is also why a database that listens only on localhost is safe from outside.
Definition
Example code
console
$ ping -c 1 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.045 msCommon mistake
Key takeaways
- 1Means itself. Every machine has its own localhost.
- 2Never leaves. The traffic stays inside.
- 3Safe for testing. Others cannot reach it.