Tech
Network Ports Explained: How Servers Know Which Application Should Handle a Request
If you're learning backend development, you've probably seen things like:
localhost:3000
localhost:5000
:80
:443
At first, the port number can seem like just another configuration value.
But why does a server need a port when it already has an IP address?
If one server is running a Node.js API, PostgreSQL, Redis, and NGINX at the same time, how does the operating system know which application should receive an incoming request?
That's the problem ports solve.
...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to