how can an application use port 80/HTTP without conflicting with browsers?

There are 2 ports: a source port (browser) and a destination port (server). The browser asks the OS for an available source port (let’s say it receives 33123) then makes a socket connection to the destination port (usually 80/HTTP, 443/HTTPS).

When the web server receives the answer, it sends a response that has 80 as source port and 33123 as destination port.

So if you have 2 browsers concurrently accessing stackoverflow.com, you’d have something like this:

Firefox (localhost:33123) <-----------> stackoverflow.com (69.59.196.211:80)
Chrome  (localhost:33124) <-----------> stackoverflow.com (69.59.196.211:80)

Leave a Comment