Difference between Post 80 and Port 8080

👤 Diwas Poudel    🕒 Jan 18 2022    📁 Fix    📜 0 comment

Before understanding the differences between port 80 and port 8080. let's know about Ports and Sockets

Everything in this universe which is connected via the internet has an address which we called it Socket Address. This Socket Address is unique whole over the world. Socket Address is a combination of IP address and port number. Socket uniquely identifies a TCP connection.

Ip address helps to find out devices on the internet or local network. Port number helps to find out a process running within the devices. Port number is considered to be a communication endpoint. With its help, we can find where the message is been requested to a server.

To find out a particular process, the port number must be different. So, we can say Port 80 and Port 8080 are different.

There are altogether 16 bits port numbers ie. 2^16 = 0 to 65535 port. 

  • From port 0 -1023 are well-known ports or system ports. It is assigned and controlled by IANA.
  • From port 1024 - 49151 are a user or registered ports. They are not assigned and controlled but registered by IANA only.
  • And Port above 49151 is a private port or dynamic port or temporary port. They are neither registered nor controlled by IANA.Port 80
Also Read :.com vs .net

Port 80

Port 80 is the most commonly used port in TCP.Web Browser by default uses port 80 to send and receive pages from the Web Server. This site: ourtechroom.com seems to not have a port, but the browser automatically requests to webserver as ourtechroom.com:80 and web server understand it is requesting for port 80 and responds back the pages or data back to the web browser. So, when you go to the browser and type: ourtechroom.com:80 then it will give the same response as you type ourtechroom.com in the browser.

Note: Port 80 is the default for unencrypted HTTP traffic.

Port 8080

Port 8080 is the port that is generally used by webservers to make TCP connections if default port 80 is busy. Generally, Port 8080 is chosen by the web server as the best alternative to 80 because it has two 80's and is above the restricted well-known port. So here Port 8080 overrides the default service port which is implied by HTTP protocol, we place a colon(:) after the domain name portion followed by the port 8080 we wish to use.

example: http://ourtechroom.com:8080

Note that two-port with the same IP doesn't exist at a time. But two-port in different IP address/hostname exists. Suppose if you host your web application on 8080 port then the user would need to navigate to for example http://xyz.com:8080 for domain xyz.com to access the web page. You can host multiple websites in one server that are using the same port because a whole socket address is distinct.

Also Read: What is localhost:8080?

Port 80 vs Port 8080

Port 80 Port 8080
The default port for HTTP Request Alternative port for HTTP requests.
When you type just domain name in URL it will request for port 80 to a web server. You have to type the domain name along with port 8080  to request the webserver for the process /program to call.
Port 80 is a well-known port. Port 8080 is a user or registered port
Port 80 is assigned and controlled  by IANA  Port 8080 is registered and controlled by IANA but registered by IANA.
Example: ourtechroom.com and ourtechroom.com:80 are the same. Similarly, localhost and locahost:80 are the same. Example:ourtechroom.com and ourtechroom.com:8080 are different. Similarly, localhost and localhost:8080 are different.

Most of the networks and firewalls do not block traffic going through 80 port

Networks and firewalls block traffic going through 8080 so we must enable rules for requests in the firewall to send/receive a request 
Also Read: Everything about .dev domain

Other default HTTP alternatives assigned by IANA are 591,8008 and 8080. (source)


Is port 8080 a secure port?

Ans: We can't tell whether the port is secure or not just by looking at it. As a result, either port 80 or 8080 is insecure by default. To secure the port, we must add an SSL certificate.

Which port should I use for my Website ?

Ans: My default, standard port for a website is 80.

For example: when you type: http://stackoverflow.com:80 then will get you to the stackoverflow.com website.

Can we close Port 80 ?

Ans: Yes, we can, but it's a bad idea from a security standpoint. You should never close port 80 if you only want to serve secure traffic via HTTPS and port 443. Most firewall software has it enabled by default.   Port 80 is basically used for unencrypted web traffic.