Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

357
Vistas
Why 0.0.0.0 is working and localhost or 127.0.01 is not

I have a grpc-go server running in docker container, listening on 0.0.0.0:8080. I found this to be working after having failures with listening on localhost or 127.0.0.1 in a docker container - and it only failed running in a docker container, not if I go run on the same machine.

Also a simple web server did work listening on localhost or 127.0.0.1.

I found that 0.0.0.0 is listening on any network adapter - but found no other explanations.

Well, problem solved - but I am looking for an explanation - do you know?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Networking is one of the namespaces in docker, similar to the pid and filesystem namespaces. If you kill pid 1 inside a container, that kills the process inside the container and not systemd/init on the host (as long as you don't override the namespace). And if you rm -rf /bin inside a container, that deletes files from that container, not from the host (as long as you don't have a volume mount). Similarly, the loopback network (localhost or 127.0 0.1) in a namespace refers to just that namespace, not the host.

Thinking about it from a higher level, loopback on the host is only reachable from that host, you cannot access it from another host, or an external load balancer. Namespaced networking works very similar. Loopback inside the container can be reached by other processes inside that same network namespace, but not containers in other namespaces, and not from the host with port forwarding since that forwards to the virtual network interface, similar to how an external load balancer forwards to the host network interface.

over 4 years ago · Santiago Trujillo Denunciar

0

This may be due to the browser cache!

In my case, I had some errors configuring the .htaccess file which makes 301 redirects. Because I tested with both localhost and 127.0.0.1, they no longer work. When I tested them with curl, I found that it's just a browser cache.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda