Module 5: IP Addresses and Ports

Lesson 4 of 5 ยท 15โ€“25 minutes

localhost

๐Ÿ The everyday picture

Leaving yourself a note on your own fridge. It never leaves the house; you're both sender and receiver.

๐Ÿ“˜What it really is

๐Ÿ–ฑ๏ธTry it

In your terminal, type ping localhost (on Mac, press Ctrl + C to stop). You'll see replies in well under a millisecond: your computer talking to itself.

โœ…Quick check

You send a friend the link http://localhost:3000 to see your new app. What will they see?

Show the answer

Nothing of yours. On their computer, localhost means their own computer, where your app isn't running.

Why do developers test on localhost first?

Show the answer

It's fast, private and safe. Mistakes don't affect real users.

โ† PreviousPublic and private addresses, and NAT
ProLearners Assist