A simple URL would normally have the pattern of protocol://host:port
:
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?
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 ofhttp://localhost:8080
In the URI
http://localhost:8080
, the partlocalhost:8080
is the authority component.The part
localhost
is the host subcomponent, the part:8080
is the port subcomponent.localhost:8080
as URIlocalhost:8080
itself is, syntactically, also an URI:localhost
would be the scheme8080
would be the pathBut as
localhost
is not a registered URI scheme,localhost:8080
is currently not a valid URI.