Why does port exist?
When I started learning web development, I did not really understand why ports are used. Now, I get why they are used, so I would like to explain it here.
Ports are used to separate and identify different processes or services running on a device in the context of computer networking. When multiple applications or services are running simultaneously on a single device, they need a way to communicate with other devices or services over the network without interfering with each other. Ports serve as communication endpoints and allow each process to have its own dedicated channel for network communication.
By convention, web servers typically listen on port 80 for HTTP (Hypertext Transfer Protocol) and port 443 for HTTPS (HTTP Secure) requests. These are the default ports assigned to these protocols by the Internet Assigned Numbers Authority (IANA). When a user accesses a website, their web browser sends requests to these specific port numbers to communicate with the web server.
Port 80 and port 443 are considered "well-known" ports, and they are used by default so that users don't need to specify the port number when entering a web address in their browser. For example, when you type http://www.example.com
in your browser, it implicitly connects to port 80. Similarly, when you enter https://www.example.com
, it connects to port 443 by default.