temporary_user_name
temporary_user_name

Reputation: 37068

What happens when I go to localhost in a browser without specifying a port?

I understand what happens when I specify a port. But what happens when I don't? It makes no sense to me since while doing development, my local grails server picks up requests from localhost without any port specification, despite that it's supposed to be on port 8080.

So what happens when you just go to localhost in a browser with no port? What controls where the request goes?

Upvotes: 3

Views: 657

Answers (1)

rodolk
rodolk

Reputation: 5907

If you don't specify the protocol it assumes HTTP. This standard defines URI: https://www.rfc-editor.org/rfc/rfc3986

If you don't specify the port, it assumes port 80.

If no server is listening in port 80, the browser will receive a RST at TCP level when it tries to establish a TCP connection (below HTTP layer). You will see a message like "Connection Refused".

Upvotes: 7

Related Questions