Reputation: 7815
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?
Upvotes: 6
Views: 1301
Reputation: 96587
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 URIlocalhost:8080
itself is, syntactically, also an URI:
But as localhost
is not a registered URI scheme, localhost:8080
is currently not a valid URI.
Upvotes: 4