Expand description
The spoolframe/client/1 wire protocol: messages, framing and ALPN
names.
Permissively licensed (MIT OR Apache-2.0); it is the boundary that proprietary clients talk across, so it never depends on an AGPL crate.
One connection carries many QUIC streams (streams). Every message
is a length-prefixed CBOR frame (codec); the messages are in
messages.
Re-exports§
pub use artwork::ArtworkFace;pub use artwork::ArtworkReply;pub use artwork::ArtworkRequest;pub use artwork::ArtworkResponse;pub use artwork::ArtworkSize;pub use features::Feature;pub use features::Features;pub use media::MAX_READ;pub use media::MediaRead;pub use media::MediaReadReply;pub use media::MediaReadResponse;pub use media::PlaybackHandle;pub use messages::AddressNetwork;pub use messages::AuthMethod;pub use messages::BeginInvitePasskey;pub use messages::ChangePassword;pub use messages::ConfirmPassword;pub use messages::DeviceAddress;pub use messages::DeviceInfo;pub use messages::DeviceSignInRequest;pub use messages::Error;pub use messages::Event;pub use messages::Hello;pub use messages::HomeScreen;pub use messages::InviteLookupOutcome;pub use messages::LoginPassword;pub use messages::LookupInvite;pub use messages::MAX_HELLO_TEXT;pub use messages::ManifestKind;pub use messages::NextMode;pub use messages::PROTOCOL_VERSION;pub use messages::PinProof;pub use messages::PinState;pub use messages::PortableSignIn;pub use messages::PortableTie;pub use messages::RedeemInvite;pub use messages::RedeemInviteWithPasskey;pub use messages::RedeemPortableInvite;pub use messages::Reply;pub use messages::Request;pub use messages::RequestEnvelope;pub use messages::Response;pub use messages::SUBTITLE_CHUNK;pub use messages::ServerInfo;pub use messages::ServerRow;pub use messages::SessionId;pub use messages::SessionInfo;pub use messages::TrackPreferencesInfo;pub use messages::TrustedProfile;pub use messages::UserSummary;pub use messages::WhoAmIReply;pub use passkeys::FinishPasskeyRegistration;pub use passkeys::FinishPasskeySignIn;pub use passkeys::LEGACY_APP_RP_ID;pub use passkeys::MAX_NAME_CHARS;pub use passkeys::NONCE_LEN;pub use passkeys::PasskeyCreation;pub use passkeys::PasskeyInfo;pub use passkeys::PasskeyRegistrationBegun;pub use passkeys::PasskeyRequest;pub use passkeys::PasskeySignInBegun;pub use passkeys::app_passkey_challenge;pub use passkeys::fit_name;pub use passkeys::is_app_rp_id;pub use playback::AudioAction;pub use playback::BitmapSubtitles;pub use playback::ChosenTracks;pub use playback::ConvertedAudio;pub use playback::ConvertedSubtitle;pub use playback::ConvertedVideo;pub use playback::PlannedAudio;pub use playback::PlannedSubtitle;pub use playback::PlaybackPlan;pub use playback::Quality;pub use playback::Rung;pub use playback::Selection;pub use playback::SubtitleAction;pub use playback::SubtitleDelivery;pub use playback::TrackReason;pub use plex::PlexLink;pub use plex::PlexSyncSummary;pub use portable::CredentialError;pub use portable::DevicePublicKey;pub use portable::InvalidDevicePublicKey;pub use portable::InvalidPortableUserId;pub use portable::PORTABLE_USER_ID_LEN;pub use portable::PortableIdentityState;pub use portable::PortableUserId;pub use portable::RevokedKey;pub use portable::StateError;pub use portable::TieProof;pub use portable::TieProofError;pub use portable::UserDeviceCredential;pub use portable::tie_message;pub use previews::PreviewTile;pub use previews::Previews;pub use search::Copies;pub use search::SearchCounts;pub use search::SearchGroup;pub use search::SearchHit;pub use search::SearchRequest;pub use search::SearchResult;pub use search::SearchResults;pub use search::TitleCopy;pub use search::TopResult;pub use server_id::InvalidServerId;pub use server_id::SERVER_ID_LEN;pub use server_id::ServerId;pub use pairing::PAIR_ALPN;
Modules§
- artwork
- Artwork over a resource stream (
crate::streams::bi::RESOURCE). - close
- QUIC application close codes a Spoolframe peer sends, with a human-readable reason beside them.
- codec
- Frames: a big-endian
u32length, then that many bytes of CBOR. - device_
sign_ in - Signing a device in by approving it on another: the code a TV shows, and the link its QR code carries.
- diagnostics
- Diagnostics an app sends to its server for the admin to read (feature
spoolframe:diagnostics): Settings › About › “Send diagnostics”. - downloads
- Downloads for offline viewing (feature
spoolframe:downloads): the messages ofcrate::Request::DownloadOptions,crate::Request::PrepareDownload,crate::Request::DownloadStatus,crate::Request::CancelDownloadandcrate::Request::SyncOfflineWatch, thecrate::Event::DownloadChangedevent, and thecrate::resource::ResourceRequest::Downloadread. - experimental
- Experimental features: messages a client and server use only
when both said so in
Hello. - features
- Regular features: how a server knows a client handles something.
- federation
- Server-to-server federation on
spoolframe/federation/1: pairing two servers, and replicating what one shares with the other (SyncLibraryand the rest). - fingerprint
- A server key’s fingerprint: a short code a person can compare between the server’s terminal and a client’s screen before the client pins the key.
- invite
- Invites: the link that finds a server from anywhere, and the code in it that lets someone make their own account there.
- invite_
admin - Making and managing invites from an app: the client protocol’s
admin requests
CreateInvite,ListInvitesandRevokeInvite. These are the same invites, with the same limits, as the web UI makes; the web UI and the apps see each other’s. - lan
- How a server announces itself on the LAN.
- media
- Playing media: playback sessions and range reads.
- messages
- The messages of
spoolframe/client/1. - pairing
- Pairing a device with a portable identity:
the link a device shows as a QR code, and the frames the identity’s
phone and the device then exchange over a direct Iroh connection on
PAIR_ALPN. No Spoolframe server takes part. - passkeys
- Passkeys in the apps, each server through a relying party of
its own under
spoolframe.app:ServerId::rp_id. - playback
- Playback plans: how the server would play an item for this client, given what it can decode and which tracks it picked.
- playlists
- Playlists (feature
spoolframe:playlists): ordered lists of movies, episodes and tracks a user makes, shares, pins and plays. - plex
- The session user’s Plex account link, as clients may read it.
Linking and unlinking are the web UI’s (
<web_url>/profile): a client only shows the state, and never sees the account’s token. - policy
- Request retry semantics and wait budgets shared by clients and servers. These do not change message encoding or protocol negotiation.
- portable
- A portable user’s identity: the public half of a root signing key the user owns, not an account any server hosts; and what that root signs: a credential for each of the user’s devices, and the state that revokes them; and the proof that ties a local account to the identity.
- previews
- Frame previews for scrubbing:
Request::GetPreviewsand its reply. - relay_
access - Who a relay of the server’s own lets through.
- resource
- One metadata frame followed by exactly
lengthraw bytes for every binary resource. Playback revisions are independent of encoder epochs. - rpc
- The RPC stream of
spoolframe/client/1. Every request goes in this wrapper: a peer that does not know it fails to decode the request, so it never loses the wrapper’s guarantees without notice. - search
- Scoped, grouped search:
Request::Searchand its reply. - search_
rank - How a search’s results are ranked and grouped once what matched is
known (P3-09): the year taken off the query, the top match, quiet
episodes left out of
All, each group cut to the limit, and the scopes counted. - server_
id - A server’s id: its name for app passkeys, apart from its key.
- streams
- What each QUIC stream on a connection is for. The first byte on a stream says.
- well_
known - The server’s document at its web address: how a device that has
only the address a person typed (
sf.example.org) learns the key to dial.
Structs§
- Audio
Summary - The audio that plays.
- Featured
- One item a TV features (
HomeScreen::featured). - Featured
Limits - How much of each row is featured.
- Hidden
Under - Episodes left out of a search because their show is in it
(
SearchResults::hidden_under). - Plan
Summary - A plan, flat (
PlaybackPlan::summary). - Play
From Choice - One copy of a title, as the Play from list shows it
(
Copies::choices). - Subtitle
Summary - The subtitle that shows.
- Video
Summary - The video that plays.
Enums§
- Featured
Row - Which of Home’s rows a featured item came from.
- Plan
Kind - What kind of play a plan is.
- Subtitle
How - How the picked subtitle is shown.
Constants§
- APP_
RP_ DOMAIN - The domain every server’s app passkeys are made under: a server’s
relying party is
<server id>.spoolframe.app. Every client and the admin API use this one value. - CLIENT_
ALPN - Development ALPN. Breaking revisions currently retain
/1and require a coordinated server/SDK update;PROTOCOL_VERSIONidentifies the revision. - FEDERATION_
ALPN - The ALPN of server-to-server federation, version 1:
federation. Experimental: a server whoseexperimental.federationis off refuses it withclose::UNSUPPORTED_PROTOCOL.