Home > Back-end >  Quick question about ports on a web address
Quick question about ports on a web address

Time:02-11

I got a little confused about sockets.
In an address like:

https://localhost:5000/

...where I am running a web server during development, I know that the HTTPS translates to the local port 443, so the question is, what is the 5000 port number in that address?

Thanks.

CodePudding user response:

HTTPS defaults to port 443, unless otherwise specified. In localhost:5000 you are explicitly specifying a port, so it's port 5000. Only https://localhost would be using port 443 implicitly.

CodePudding user response:

when you request localhost:5000, the browser will go to the webserver on the localhost, but on port 5000, this means that if your webserver is setup to work on port 5000 or one of it's virtual hosts are setup to work on port 5000 you will get a response,

Read this line very carefully thrice, the browser will go to the webserver on the localhost, but on port 5000, so , answer to the question what is the 5000 port number in that address? is that the webserver will try to find a response from port number 5000 , it will not go and find response on any other location . read more about port numbers here I hope it makes sense to you ! Thanks !

  • Related