Trying to access Google server on different ports

httpinternetporturl

Why is that

http://www.google.com:443/

fails almost instantaneously, while

http://www.google.com:8080/

takes some more time before failing?

If there is no server on these ports, both the requests should go through the same process and should take the same amount of time to fail. What is the difference?

Best Answer

Google does keep a server running on port 443. If you browse to https://www.google.com or https://www.google.com:443, you'll get the normal Google search page over SSL.

When you use the URL http://www.google.com:443, you're telling the browser to make a request over port 443, but to use non-encrypted HTTP. Google has their server configured to reject this and close the connection since it expects only HTTPS over that port.

However, Google's servers are not listening on port 8080. When you make a request to port 8080, your browser has to wait for the timeout before it decides that the request failed.


You can prove all this to yourself by opening a telnet session to www.google.com:443 and trying to speak unencrypted HTTP to it:

[~]$ telnet www.google.com 443
Trying 66.102.7.104...
Connected to www.l.google.com.
GET / HTTP/1.0
Connection closed by foreign host.

If you try the following command, you'll see that you can't connect to port 8080 at all and it takes a long time to timeout:

[~]$ telnet www.google.com 8080
Trying 66.102.7.104...
telnet: connect to address 66.102.7.104: Operation timed out