- Notifications
You must be signed in to change notification settings - Fork9
websocket filesystem based on libfuse
License
falk-werner/webfuse
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
webfuse combines libwebsockets and libfuse. It allows to attach a remote filesystem via websockets.
Many embedded devices, such as smart home orIoT devices are very limited regarding to their (non-volatile) memory resources. Such devices are typically comprised of an embedded linux and a small web server, providing an interface for maintenance purposes.
Some use cases, such as firmware update, require to transfer (larger) files to the device. The firmware file is often stored multiple times on the device:
- cached by the web server, e.g.lighttpd
- copied to locally, e.g. /tmp
- uncompressed, also to /tmp
Techniques likeSquashFS help to avoid the third step, since the upgrade file can be mounted directly.RAUC shows the use of SquashFS within an update facility.
However at least one (unecessary) copy of the upload file is needed on the device.
To avoid Steps 1 and 2, it would be great to keep the update file entirely in web server, just likeNFS orWebDAV. Unfortunately, NFS is not based on any protocol, natively usable by a web application. WebDAV is based on HTTP, but it needs a server providing the update file.
webfuse solves this problem by using theWebSocket protocol. The emdedded device runs a service, known as webfuse adapter, awaiting incoming connections, e.g. from a web browser. The browser acts as a file system provider, providing the update file to the device.
With webfuse it is possible to implement remote filesystems based on websockets.Therefore, webfuse defined two roles participating in a webfuse connection:
- webfuse service
- webfuse provider
Awebfuse service
is both,
Thewebfuse service
awaits incoming connections from awebfuse provider
. Once connected, it communicates all the filesystem requests originated by thelibfuse
to the connectedwebfuse provider
using thewebsocket
-basedwebfuse protocol
.
By doing so,webfuse
allows to inject a filesystem to a remote device.
Awebfuse provider
provides a filesystem to a remote device using thewebsocket
-basedwebfuse protocol
. Therefore, awebfuse provider
implements awebsocket
client.
davfs2 is a Linux file system driver that allows to mount aWebDAV resource. WebDAV is an extension to HTTP/1.1 that allows remote collaborative authoring of Web resources.
Unlike webfuse, davfs2 mounts a remote filesystem locally, that is provided by a WebDAV server. In contrast, webfuse starts a server awaiting client connections to attach the remote file system.
About
websocket filesystem based on libfuse