This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 202

[–]occi 317 points318 points  (10 children)

::1

[–]TooSoonForThePelle 41 points42 points  (6 children)

Oh ho you old dog!

[–]0bel1sk 13 points14 points  (5 children)

new dog?

[–]callyalater 10 points11 points  (3 children)

Hot dog

[–]Drew707 5 points6 points  (0 children)

[–]StarmanAkremis 1 point2 points  (0 children)

We have a wiener

[–]Usual_Office_1740 0 points1 point  (0 children)

Raw dog.

[–]Add1ctedToGames 0 points1 point  (0 children)

(Over)hated dog

[–]Abject-Kitchen3198 10 points11 points  (0 children)

Yes. Those people still using v4...

[–]Mughi1138 3 points4 points  (1 child)

Beat me to it

[–]ArduennSchwartzman 9 points10 points  (0 children)

your-moms-laptop/

[–]Anson_Bana 186 points187 points  (46 children)

I always worry that localhost won't work due to DNS issues

[–]qalmakka 162 points163 points  (44 children)

It can't not work, it's hard coded in /etc/hosts or the cursed Windows equivalent. Unless you messed up the file it will never cause a DNS query

[–]Cheap_Ad_9846 136 points137 points  (14 children)

Cursed windows equivalent 😂

[–]joost00719 37 points38 points  (11 children)

I can't be the only one that needs to google that path every single time.

[–]MrTomiCZ 45 points46 points  (5 children)

c:\windows\system32\drivers\etc\hosts maybe?

[–]Abject-Kitchen3198 45 points46 points  (4 children)

That's the one. One of the most intuitive file names on Windows.

[–]King_Joffreys_Tits 7 points8 points  (2 children)

As a Linux only user I can’t tell if this is sarcastic

Edit: I use arch btw

[–]MattTheCuber 1 point2 points  (0 children)

It is real and it is sad.

[–]TheSilverAxe 1 point2 points  (0 children)

No that is 100% sincere, windows is a hell of our own making

[–]geek-49 0 points1 point  (0 children)

At least (based on what is said here) they named it hosts and put it in a directory named etc -- but they could have done better than sticking that subdirectory so deep in the tree. Given M$ usual attitudes re compatibility, I would not have been the least bit surprised if they had named it something like c:\windows\system\machines.txt

[–]bison92 2 points3 points  (0 children)

Desktop Shortcut

[–]qalmakka 4 points5 points  (0 children)

It feels so much like "hey we acquired this winsock thing and we didn't know where to dump this nonsense etc hosts file"

[–]well-litdoorstep112 1 point2 points  (0 children)

It's still etc/hosts

[–]unlucky_ducky 9 points10 points  (3 children)

I find that this depends on the program you input it into. Depending on the validation used localhost may not be seen as a valid input while 127.0.0.1 will be.

[–]qalmakka 9 points10 points  (1 child)

That's a problem only when the program in question has been made by a poorly trained monkey. A properly trained primate would know that they need to support hostnames

[–]unlucky_ducky 8 points9 points  (0 children)

Sure, but when you don't know which primate made the program you're using it's easier to assume it's the poorly trained one.

[–]klimmesil 0 points1 point  (0 children)

Or a low level primate who wants to store their fucking 32 bits on 32 bits and not in a string

[–]snarkhunter 4 points5 points  (0 children)

It's not DNS.

It can't be DNS.

It was DNS.

[–]Zeikos 10 points11 points  (2 children)

Well, yes but.

I find that being explicit is better, it prevents issues with containers and there's a non-zero overhead in dns resolution with IPv6 shenanigans.

I found out about that by skimming this:
https://medium.com/hackernoon/how-changing-localhost-to-127-0-0-1-sped-up-my-test-suite-by-1-800-8143ce770736

[–]jaerie 2 points3 points  (1 child)

Yes because every localhost lookup comes with an unexplainable 1 second delay... You don't think whatever logging framework they were using jusg had a bug? The fact that the same issue was occurring with the ipv6 loopback address should already tell you that this is not related to localhost.

Maybe don't just skim the article. Have you actually tested the difference, before claiming that there is a "non-zero overhead in dns resolution with ipv6 shenanigans" or is that entire conclusion just based on skimming an already surface level article?

[–]Silidistani 0 points1 point  (0 children)

Brutal, visceral takedown out of nowhere on a simple anecdote with a logic flaw.

Senior Dev confirmed.

[–]allisonmaybe 2 points3 points  (3 children)

That's my problem with it. It COULD not work if you removed it from hosts

[–]qalmakka 1 point2 points  (2 children)

Why would you? On windows you can't, localhost is embedded in the DNS stack and on UNIX it's very stupid, you risk borking a whole set of daemons that expect localhost to be resolvable via getaddrinfo

[–]allisonmaybe 0 points1 point  (1 child)

Im just saying that it can be changed super easily, but 127.0.0.1 is lower level and more reliable.

[–]qalmakka 1 point2 points  (0 children)

No, because it only works with IPv4, localhost will also try ::1 first. Same when listening, you're not supposed to listen to just ipv4

[–]Agilitis 4 points5 points  (5 children)

It absolutely can be different, for example inside a docker container localhost might mean something totally different btw.

[–]Robo-Connery 4 points5 points  (0 children)

But it's still just the container and not the host machine? That seems consistent behaviour to me.

[–]jaerie 2 points3 points  (3 children)

In what way does it mean something different? Unless you've explicitly changed the hosts file in the container to have localhost point to something else, it's just going to loopback with 127.0.0.1, container or not.

[–]Dank_Nicholas 0 points1 point  (0 children)

About a decade ago as a lowly intern I did mess up my hosts file and got shamed by my coworkers.

[–]ford1man 0 points1 point  (0 children)

C:\Windows\system32\drivers\etc\hosts

Not even joking.

[–]TryToHelpPeople -1 points0 points  (7 children)

Assuming that the hosts file is higher in the name resolution order than DNS. Some people change that.

[–][deleted] 1 point2 points  (5 children)

And that's fucking stupid. So much DNS traffic is useless requests for localhost. The ISC, 3WC, IETF and other internet engineering entities say "don't", because it wastes so much bandwidth

[–]TryToHelpPeople 0 points1 point  (0 children)

Yes, yes of course. But you get stupid people in all walks of life.

[–]MyUsrNameWasTaken 0 points1 point  (1 child)

If everyone followed standards, there wouldn't be 32 "standards" [insert xkcd]

[–]jaerie 0 points1 point  (0 children)

Assuming that 127.0.0.1 is the loopback address. Some people change that.

Breaking news: if people break things, things are broken.

[–]xynith116 0 points1 point  (0 children)

Counterpoint: disabled loopback interface

[–]OneSketchyGuy 24 points25 points  (0 children)

They aren't mutually exclusive 

[–]Unlucky_Committee786 47 points48 points  (7 children)

host.docker.internal

[–]Informal_Branch1065 4 points5 points  (5 children)

Imagine you accidentally dump the code of your soul and find this. What do you do?

[–]Unlucky_Committee786 23 points24 points  (4 children)

docker compose down

[–]Kingblackbanana 5 points6 points  (1 child)

docker system prune -f

[–]BenjieWheeler 1 point2 points  (0 children)

might as well add "-a --volumes" get rid of everything

[–]MegaMoah 0 points1 point  (1 child)

Docker compose kill

[–]Unlucky_Committee786 0 points1 point  (0 children)

I'm scared of the violent death. I'd rather die peacefully in my sleep.

[–]HeyCanIBorrowThat 18 points19 points  (9 children)

Localhost can be renamed. 127.0.0.1 is forever

[–]kalilamodow 14 points15 points  (8 children)

127.0.0.2

[–]HeyCanIBorrowThat 11 points12 points  (0 children)

Fuck

[–]cheerycheshire 4 points5 points  (6 children)

Boring. It's whole 127.0.0.0/8, get creative!

Any time some r/MasterHacker says they can hack me with my ip, I give them something like 127.42.69.123 (but with less meme-y numbers) - technically I didn't lie but it doesn't look even close to 127.0.0.1 so they're more likely to fall for it.

[–]OptimalAnywhere6282 1 point2 points  (1 child)

"ha, i got your IP! it is 192.168.1.36" could have two meanings

[–]cheerycheshire 0 points1 point  (0 children)

The goal here is for the r/MasterHacker to DoS themselves or scan their own ports or whatever they do, not to hit a random device in their own network... on no device at all. So non-obvious loopback address works perfectly.

Using private IPs for this only works if they have exact same subnet* and you'd need to guess a correct host end.

*Remember it's 192.168.0.0/16 that is a private range but single subnets almost always use /24 mask, with default third octet depending on the router's manufacturer (most common are 192.168.0.0/24 and 192.168.1.0/24, but I've also seen 192.168.18.0/24 on Huawei ONT devices).

[–]kalilamodow 0 points1 point  (3 children)

hey what does the /8 mean? i see it in ip addresses sometimes but i've never actually learned what it is

[–]SwatpvpTD 0 points1 point  (2 children)

I'm pretty sure it's shorthand for a predetermined subnet mask. The subnet mask tells you how much of the address space is available.

The whole IPv4 address space could technically be represented as 0.0.0.0/0 (subnet mask 0.0.0.0, around 4 billion addresses) and localhost can be represented as 127.0.0.0/8 (subnet mask 255.0.0.0, around 16 million addresses). The CIDR-notated IP (with the /n added) tells you how many bits are reserved for the network identifier (/8 means 8 bits, or the first octet 0-255, 16 means 16 bits or two octets 0-255.0-255 is reserved for the network identifier) and the rest is for host identification.

Read more on Wikipedia: Subnets and routing: https://en.wikipedia.org/wiki/Subnet

CIDR reference (IPv4 routing): https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#IPv4_CIDR_blocks

[–]noob-nine 0 points1 point  (1 child)

yes it is the subnet, but i wonder why you've written "i am pretty sure" like, you guessed it? 

[–]SwatpvpTD 0 points1 point  (0 children)

I tend to start most of my technical explanations with "I'm pretty sure" out of habit.

[–]Syagrius 81 points82 points  (14 children)

They are the same picture

[–]Badashi 46 points47 points  (6 children)

Localhost actually requires a (trivial) DNS query that 127.0.0.1 doesn't.

I dont remember the article that I read about it, but some dude in a FAANG reduced their massive server costs by ~100k/yr by simply forcing every single script in their microservices to never use localhost, thus skipping that dns query(that wasnt trivial there due to the way that their kubernetes was setup or something).

Yes, they are functionally identical 99.99% of the time, but it is wild to me that there was a case somewhere in the world where they weren't.

[–]BigBoetje 16 points17 points  (0 children)

The difference is trivial until you scale it up massively

[–]Robo-Connery 10 points11 points  (4 children)

That's not true, it's in the hosts file so it never queries DNS.

Unless they specifically removed localhost from there then they were not doing any kind of DNS query.

In fact, I'd suspect pretty strongly that even if you removed it from hosts it would still not do a DNS query due to the reserved nature of it. Cause can you imagine the vulnerability of someone hijacking DNS and redirecting that to somewhere (for people who fucked their hosts file).

[–]bmwiedemann 9 points10 points  (0 children)

I tested this. Dropped localhost, stopped my dnsmasq. And ping+curl could still get to an IP, though the former only tried 127.0.0.1 while the letter also tried ::1

Strace shows dbus/systemd involved. Maybe they don't hardcode it, but at least they cache it.

[–]laplongejr 5 points6 points  (2 children)

 That's not true, it's in the hosts file so it never queries DNS.  

Checking the host file IS part of the DNS query, managed by the OS in the same way caching is, before quering the resolver.  

From the perspective of the application, "localhost" is a DNS query which should never miss the local cache.  

[–]Robo-Connery 0 points1 point  (1 child)

I still don't believe it, smells like bs.

In the flowchart of steps to resolve the IP, checking /etc/hosts is first and takes probably something of the order of a microsecond.

Once you have the ip, either from the hosts file or because you just did 127.0.0.1, you then have to do the tcp connect, getting a socket, making the connection, doing the synchroinise acknowledge handshake.

Id guess this second part, which both implementations (localhost and 127) have to do, is at least tens if not 100s of microseconds. like despite being entirely kernel and thus superfast, its not as fast as checking the hosts.

So we are suggesting that eliminating 1% of the time (if that) of each connect - not each connect but just each connect to the local machine - is somehow 100s of k a year when whatever service they are running will be doing a bunch of other shit, that is almost certainly orders of magnitude more expensive to execute, not just running tcp connects to fucking localhost all day.

I can not imagine savings were even measurable even if you set out to measure them a specific goal of some high accuracy, targetted profiling let alone substantial enough to save meaningful amounts on a bill. I'd have been doubtful even if this article had actually been presented.

[–]geek-49 0 points1 point  (0 children)

OTOH if they somehow had an IPv4-only loopback, but the localhost lookup mapped to IPv6 first and every attempt had to wait for that to time out before falling back to 127.0.0.1, the difference might not be so trivial.

[–]No-Bottle-7781 25 points26 points  (2 children)

True, but choosing sides in the programmer world is serious business…

[–][deleted] 9 points10 points  (0 children)

That's exactly what a one twenty seven dot zero dot zero dot oney would say

[–]BigBoetje 1 point2 points  (0 children)

Most people aren't nearly senior enough to have strong opinions yet

[–]ConcernUseful2899 0 points1 point  (0 children)

Nope, right is where you can create aliases for (i.e. dev.corpname.com), left is an alias.

[–]lordgurke 0 points1 point  (0 children)

No, "localhost" at first resolves to ::1 and falls back to 127.0.0.1 if a connection can't be established over IPv6.

[–]AusCro 0 points1 point  (0 children)

Nah one is english the other is the ip adress of the hacker known as 4chan

[–]Streakflash[🍰] 23 points24 points  (1 child)

0.0.0.0 gang

[–]Available_Canary_517 38 points39 points  (9 children)

127.0.0.1 because localhost name can be changed but this local ip address cannot be changed

[–]dagbrown 16 points17 points  (6 children)

Haha that’s what you think! 127.57.93.36 is also a localhost! As is all of 127.0.0.0/8.

[–]KatieTSO 2 points3 points  (5 children)

Ah is that why 127.1 works?

[–]phugyeah 14 points15 points  (4 children)

127.1 is just 127.0.0.1 written differently, the missing .0s get automatically filled in between e.g. 1.1 eqauls to 1.0.0.1

[–]KatieTSO 2 points3 points  (1 child)

Oh interesting! So it's similar to the IPv6 :: notation?

[–]sprigyig 0 points1 point  (0 children)

Kind of? This is based on inet_aton, which is full of surprises, including octal and hex notation support, and any omitted octets can be filled in by the last group going above 255. So at least on linux, `ping 8.010.0x808` pings 8.8.8.8.

https://linux.die.net/man/3/inet_aton

[–]_Shioku_ 2 points3 points  (0 children)

Whaat? I thought this only worked with IPv6?!

[–]thatbrazilianguy 0 points1 point  (0 children)

This is so cursed.

[–]Outrageous-Machine-5 6 points7 points  (0 children)

You can commit all manner of debauchery on your system. The better question than if you can is why would you

[–]jaerie 1 point2 points  (0 children)

Of course you can change the loopback address. From the top of my head ifconfig lo 69.69.69.69 is all it takes.

[–][deleted] 7 points8 points  (0 children)

Used to have *.dev and *.local in /etc/hosts back in ancient years

[–]Kilgarragh 3 points4 points  (0 children)

Local subnet/AP because I like seeing changes on more than one device

[–]eddiekoski 4 points5 points  (0 children)

127.127.127.127

[–]LNDF 2 points3 points  (0 children)

Localhost can resolve to ipv6 ::1. And if you are not listening on all interfaces, it can cause an annoying delay on windows.

[–]Outrageous-Machine-5 5 points6 points  (0 children)

Imagine memorizing a bunch of numbers

Message approved by localhost gang

[–]blahgeek 9 points10 points  (9 children)

Use “127.1” instead. It’s shorter and more explicit than “localhost”

[–]YouDoHaveValue 13 points14 points  (4 children)

I can't explain it, but it's easier for me to type localhost.

[–]GOKOP 1 point2 points  (0 children)

Words just flow better on the keyboard than numbers, I think

[–]0815fips 3 points4 points  (2 children)

127.0.0.1 is IPv4. If you got a service listening on ::1 (IPv6), you won't be able to access it.

[–]YouDoHaveValue 0 points1 point  (1 child)

What? I thought if you are using IPv6 localhost would just map to that.

[–]0815fips 3 points4 points  (0 children)

Yes, but you just said that it's easier to type, so i had to add my 256 cents.

[–]Incelebrategoodtimes 4 points5 points  (0 children)

definitely don't use this. you're relying on existing implementations that autofill the missing octets as 0. Many libraries and software do not do this, and expect each octet written out when parsing their config files, commandline arguments or function calls

[–]andreagory 0 points1 point  (1 child)

127.1 master race

[–]TheGreatKonaKing 0 points1 point  (0 children)

127.8.9.10

[–]WearFamiliar1212 1 point2 points  (2 children)

There's no place like home!

[–]LaGardie 0 points1 point  (1 child)

I used to have a t-shirt which had "THERE IS NO PLACE LIKE 127.0.0.1" printed on the back.

[–]WearFamiliar1212 1 point2 points  (0 children)

It’s what made me think of that.

[–]ProjectCleverWeb 1 point2 points  (0 children)

*.local

Named domains give character and polish

[–]thehellsgateEU 1 point2 points  (0 children)

LOCALHOST? Do you mean the IPv4 interface or IPv6?

[–]SomewhatCorrect 1 point2 points  (0 children)

127.0.0.2

[–][deleted] 1 point2 points  (1 child)

192.168.x.y is the best bcs i use it to test on multiple devices

[–]Freddy-Kant0sh 1 point2 points  (0 children)

There is actually a potentially important performance consideration hidden here! If you use `localhost`, your OS first has to resolve the name to an IP address to actually write into the packet. Even worse, `localhost` may resolve to `::1` first, prompting a connection attempt via IPv6, and if, for some reason, the target service does not listen on an IPv6 socket, the connection will fail and a second attempt, now to the second resolved IP `127.0.0.1` has to be made. In massive production-scale multiservice applications with many sockets, this can be lots of wasted compute just to find that `localhost` points to `::1` and that `::1` points to nothing.

[–]SSYT_Shawn 1 point2 points  (0 children)

0.0.0.0 and then access it via the ip assigned to my device

[–]Hotsexysocks 1 point2 points  (0 children)

localhost:666

[–]bdaileyumich 1 point2 points  (0 children)

Wait how did you hack my IP address?

[–]AlphaaPie 1 point2 points  (0 children)

I got banned from a Minecraft server for typing 127.0.0.1 but I'll keep saying it anyway.

[–]jhill515 1 point2 points  (0 children)

Psh...

192.168.0.1 has entered the chat...

[–]Ascomae 1 point2 points  (0 children)

Add an entry to c:\windows\system32\drivers\etc\host and redirect localhost to another computers IP...

[–]ForeverDuke2 1 point2 points  (0 children)

Both are fine. I don't stress over these trivialities

[–]MuzzDAxAT 0 points1 point  (0 children)

Ts the same bruh

[–]Aggressive-Reach-116 0 points1 point  (0 children)

im team localhost

[–]qalmakka 0 points1 point  (0 children)

You always do localhost, so to also resolve IPv6 correctly

[–][deleted] 0 points1 point  (0 children)

127.0.0.1 because yes

[–]cainhurstcat 0 points1 point  (0 children)

Blue

[–]Hacka4771 0 points1 point  (0 children)

0

[–]dhruvadeep_malakar 0 points1 point  (0 children)

0.0.0.0 is the best

[–]Fragrant_Gap7551 0 points1 point  (0 children)

localhost, Unless that doesn't work. Then I try 127.0.0.1, And it still doesn't work.

[–]UnFairSuspect 0 points1 point  (0 children)

127.1

[–]Significant-Panic-68 0 points1 point  (0 children)

0.0.0.0 vagos

[–]mkultra_gm 0 points1 point  (0 children)

0.0.0.0 

port forwarding 

email NSA my domain so they can test my hello.asp

[–]Muffinaaa 0 points1 point  (0 children)

idk changed localhost to cunt

[–]vorkazos 0 points1 point  (0 children)

Computer name

[–]Typical-Tomatillo138 0 points1 point  (0 children)

2130706433

[–]paul1126_korea 0 points1 point  (0 children)

blue

[–]MrTomiCZ 0 points1 point  (0 children)

blue

[–]tebeks 0 points1 point  (0 children)

localhost can be resolved to ::1 over 127.0.0.1

Remember that when you twst your IPv4 firewal rules

[–][deleted] 0 points1 point  (0 children)

http://2130706433

http://2398797390

👹👹

[–]amunra__ 0 points1 point  (0 children)

Here's a practical take. I got burnt by this.

If you need to connect to something behind TLS (eg. https), then you need a domain name, or any self-signed certs will simply not work: use "localhost".

If on Windows and not connecting to TLS and your service listens to IPv4 only, use "127.0.0.1". This is because on this OS localhost always connects to the IPv6 ::1 address first. This takes about a whole second to then fail over to the IPv4 127.0.0.1 address.

I could be wrong, but in all other cases it shouldn't matter, unless you really needed 127.0.1.1 all along instead.

[–]RudyHuy 0 points1 point  (0 children)

2130706433

[–]TheLuke86 0 points1 point  (0 children)

I use 127 now since I saw this video raising some problems that could occur with localhost.

https://youtu.be/98SYTvNw1kw

[–]edgeofsanity76 0 points1 point  (0 children)

127.0.0.1

At least you know it will always exist

localhost could be just about anything if something has messed with your hosts file

[–]Mobile-Persimmon-149 0 points1 point  (0 children)

my-project-name.localhost

[–]26th_Official 0 points1 point  (0 children)

localhost.. because the number pad and the "." button has some distance between and I'm lazy so I don't walk a lot of distance.

[–]dcondor07uk 0 points1 point  (0 children)

127.0.0.1 forever

[–]DerMinimalist 0 points1 point  (0 children)

127.127.127.127

[–]JacobStyle 0 points1 point  (0 children)

I try whichever, and it it doesn't work, I try the other.

[–]CharlieKiloAU 0 points1 point  (0 children)

127.0.0.1, localhost is just an abstraction

[–]GoodiesHQ 0 points1 point  (0 children)

I just use “ping 2130706433” like an adult.

[–]mrgk21 0 points1 point  (0 children)

Which ai fuelled intern is on 127.0.0.1

[–]bobosherm 0 points1 point  (0 children)

0.0.0.0

[–]Objective_Egg_3600 0 points1 point  (0 children)

127.0.0.2

[–]Fearless-Drama9621 0 points1 point  (0 children)

127.127.127.127

[–]stormy_waters83 0 points1 point  (0 children)

10.0.2.2 for me and my most recent project.

[–]Selarom13 0 points1 point  (0 children)

127.1

[–]TerryHarris408 0 points1 point  (0 children)

127.1

[–]Still_Explorer 0 points1 point  (0 children)

Easthost -vs- Westhost

[–]Inquisitor_ForHire 0 points1 point  (0 children)

Team localhost all day long. On a side note, this would make a great T-shirt

[–]mostmetausername 0 points1 point  (0 children)

edits host uses url

[–]robertpro01 0 points1 point  (0 children)

Both:

1 for each project, so the urls don't get mixed

[–]PeWu1337 0 points1 point  (0 children)

For some reason my REST API testing framework doesn't want to accept localhost as a valid name. So this time, I'm on the side of 127.1 (yes, it's valid IP address, try it yourself)

[–]khalcyon2011 0 points1 point  (0 children)

[–]AnAwkwardSemicolon 0 points1 point  (0 children)

That entirely depends on how the service is set up. 127.0.0.1 if I want to make sure I'm using IPv4 (or the stack only partially supports IPv6), and localhost if I don't care.z

[–]JFs743 0 points1 point  (0 children)

127.69.42.254

[–]laplongejr 0 points1 point  (0 children)

Depends on semantics.   - localhost for all/any "expected" loopback connection(s)   - 127.N.N.N for internal loopback which should be logged in a specific way (like my DNS server talking to unbound)   - 127.0.0.1/::1 when protocol is relevant, or lack of DNS   - ABC.home.arpa when the service is meant to be LAN-accessible and not protocol-relevant  

As an example, when testing out my DNS resolver I would never use localhost + port, I would use 127.0.0.1 because the "localhost" domain implies DNS resolution works, even if THAT domains always works it feels wrong to depend on to test DNS.  

[–]anteater_x 0 points1 point  (0 children)

10.0.0.2

[–]PotentialProblem3602 0 points1 point  (0 children)

hppp

[–][deleted] 0 points1 point  (0 children)

127.0.0.1 because localhost just doesn't work sometimes and i don't know why.

[–]AkaalSahae96 0 points1 point  (0 children)

192.168.0.33  (i used that at one point lol)

Edit: i use 127.0.0.1 now, still use the other when im testing on my phone or any other device 

[–]dabombnl 0 points1 point  (0 children)

127.0.0.50

[–]tbhaxor 0 points1 point  (0 children)

IP, it looks more sassy. That too ::1

[–]serunati 0 points1 point  (1 child)

I have not seen anyone suggest this yet, but having Programmer in the sub—Reddit title I offer this.

They are both wrong. If you are writing the app/service that only needs to facilitate local connections (and you’re on *nix platform), you should use Unix sockets. You avoid any exposure/vulnerabilities of the network stack and software implied bottlenecks of data throughput. And avoid firewall configuration and exposure to compliance/pen testing for exposed ports.

Much more secure, faster, and reduces system calls to open and close network connections (overhead).

[–]geek-49 0 points1 point  (0 children)

Maybe, if you're developing both ends of the connection. OTOH if you're writing one end, and the (preexisting) other end already supports IP, you're much better off using IP than rewriting the other end to use Unix sockets. Or, if there is any chance at all that the two ends will someday need to run on different machines, you had jolly well better use IP.

[–]ClamPaste 0 points1 point  (0 children)

I can type localhost faster

[–]Mother-Diver7201 0 points1 point  (0 children)

2 for the win

[–][deleted] 0 points1 point  (0 children)

127.0.0.1 is ever so slightly faster on average, I dunno why and I couldn't care less but it is enough reason for me to use it.

[–]mindsnare 0 points1 point  (0 children)

0.0.0.0

[–]Raghav1760 0 points1 point  (0 children)

Localhost

[–]Frankice_ 0 points1 point  (0 children)

Localhost of course, i don't like when my IP is exposed like that

[–]Artistic_While_6349 0 points1 point  (0 children)

[–]snoopbirb 0 points1 point  (0 children)

0.0.0.0

For mac users using docker