Is there a name for a URL with no protocol?

917 views Asked by At

A simple URL would normally have the pattern of protocol://host:port:

http://localhost:8080

But if I omit the protocol:

localhost:8080

Is it still a URL or does it have a different name?

I am aware of the existence of protocol-relative URLs, is this also a case of them?

1

There are 1 answers

0
unor On BEST ANSWER

localhost:8080 can’t be a relative reference, as these have to begin with // (in which case it would be a network-path reference, typically called protocol-relative reference), with /, or with a path segment that doesn’t contain :.

(For the latter case, you could use ./localhost:8080.)

localhost:8080 as part of http://localhost:8080

In the URI http://localhost:8080, the part localhost:8080 is the authority component.

The part localhost is the host subcomponent, the part :8080 is the port subcomponent.

localhost:8080 as URI

localhost:8080 itself is, syntactically, also an URI:

  • localhost would be the scheme
  • 8080 would be the path

But as localhost is not a registered URI scheme, localhost:8080 is currently not a valid URI.