Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can one port listen for two different protocols?

Hi can the same port be used to listen to two different protocol request.. i.e.. can I use the same port for both http and https requests??

like image 743
garima Avatar asked Oct 18 '25 05:10

garima


2 Answers

You can only do this if all of the protocols require the client to send data first. You can write a pseudo-server to read data and detect the protocol in use and redirect it to the appropriate local server. With protocols like ssh, this cannot be done since the server sends data first and the client responds to it.

like image 186
cdhowie Avatar answered Oct 20 '25 20:10

cdhowie


You could, but you'd have to write your own listener on that port that could handle both situations. There are no web servers I know of that can do it.

like image 40
Jacob Avatar answered Oct 20 '25 19:10

Jacob



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!