The file URI scheme (RFC 8089) identifies files on a host’s own file system with a URL such as file:///etc/hosts. It is not a network protocol; it lets the same URL-driven tools, browsers and libraries that fetch remote resources read local ones.
file URI scheme
The file URI scheme, specified in RFC 8089, gives a local file a URL: file:///path/to/file, or file://host/path in principle. There is no wire protocol. The scheme exists so that anything which takes a URL can take a local path too.
- One addressing model - Browsers, curl, OpenAPI
$refresolution and agent tooling handle local and remote resources the same way. - Host is usually empty - Hence the triple slash; remote hosts in
file://URLs are rarely supported. - A security boundary - A server that fetches user-supplied URLs must refuse
file://, or it will read its own disk for an attacker.
The file scheme is the clearest case of the URL as the real interface: if you can name a resource, a tool can fetch it, wherever it lives.