2

Possible Duplicate:
How does localhost 127.0.0.1 work?

I'm wondering how does localhost:8080 works? Who is sitting behind the scenes and handling my request's? How all request's are handling simultaneously and who does this job?

2
  • Is this a serious question?
    – jathanism
    Jun 19, 2012 at 5:41
  • 1
    @jathanism: yes it is!
    – Ant's
    Jun 19, 2012 at 5:47

4 Answers 4

4

Your operating system's hosts file contains this entry:

127.0.0.1       localhost

127.0.0.1 belongs to the loopback network interface, which is available whether you have an actual network connection or not. You can therefore run a web server and tell it to listen for connections on port 8080 to the 127.0.0.1 address, which you can connect to even when disconnected from the Internet.

The :8080 part of the URL tells your web browser to connect to port 8080 rather than the usual port 80 used for HTTP connections. Developers often run local web servers on port 8080 because Unix-like systems (Mac OS X and Linux) only allow the user "root", the "superuser", to listen for connections to port numbers below 1024. (8080 is greater than 1023, allowing the developer to run the server from his own user account rather than as a system service.)

3

Localhost actually is aliased to 127.0.0.1 in hosts.txt in many systems. You need some kind of server listining to that port of course, and any request there gets sent to the loopback adaptor in linux or its equivilent in windows.

3

Any program running on your computer can answer a network request on a port that isn't already in use. "Localhost" is a "Well known" address meaning the local machine, via IP address 127.0.0.1

Now, which program running on your computer is listening to port 8080? I don't know. Determining that depends on your hardware and software.

http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers says that 8080 is often used for proxy and caching programs as well as Apache, which is web server software you can choose to run. But it could be anything.

0

In computer networking, localhost (meaning this computer) is the standard hostname given to the address of the loopback network interface

Wiki

Not the answer you're looking for? Browse other questions tagged .