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::ArtworkReply;pub use artwork::ArtworkRequest;pub use artwork::ArtworkResponse;pub use artwork::ArtworkSize;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::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::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::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::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::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::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 (P3-07): the code a TV shows, and the link its QR code carries.
- downloads
- Downloads for offline viewing (PX-38, 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 (PX-49): messages a client and server use only
when both said so in
Hello. - federation
- Server-to-server federation on
spoolframe/federation/1(P8-01, ARCHITECTURE §26–§28): pairing two servers, and replicating what one shares with the other (SyncLibraryand the rest, P8-02). - fingerprint
- A server key’s fingerprint (P1-21, ARCHITECTURE §19): 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 (P6-01): 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 (PX-44): the client protocol’s
admin requests
CreateInvite,ListInvitesandRevokeInvite, with P6-01’s semantics, limits and store; the web UI’sinviteCreateand the apps make the same invites and see each other’s. - lan
- How a server announces itself on the LAN (P1-13, ARCHITECTURE §18).
- media
- Playing media: playback sessions and range reads (ARCHITECTURE §34, P1-08).
- messages
- The messages of
spoolframe/client/1. - pairing
- Pairing a device with a portable identity (P7-03, ARCHITECTURE §47):
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 (P3-19), each server through a relying party of
its own under
spoolframe.app(PX-14):ServerId::rp_id. - playback
- Playback plans (ARCHITECTURE §6, §8): how the server would play an item for this client, given what it can decode and which tracks it picked.
- playlists
- Playlists (PX-40, 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 (P3-12), 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 (P7-01, ARCHITECTURE §42–§43): the public half of a root signing key the user owns, not an account any server hosts; and what that root signs (P7-02, §45, §48): 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 (P7-04).
- previews
- Frame previews for scrubbing (P3-13):
Request::GetPreviewsand its reply. - relay_
access - Who a relay of the server’s own lets through (P6-04).
- resource
- One metadata frame followed by exactly
lengthraw bytes for every binary resource. Playback revisions are independent of encoder epochs. - rpc
- Development revision 3 of the
/1RPC stream. The wrapper is mandatory; old binaries fail decoding instead of silently losing the new guarantees. - search
- Scoped, grouped search (P3-09):
Request::Searchand its reply. - 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 (ARCHITECTURE §33). The first byte on a stream says.
Constants§
- APP_
RP_ DOMAIN - The domain every server’s app passkeys are made under: a server’s
relying party is
<server id>.spoolframe.app(PX-14). Kept here, the crate every client and the admin API share, so all of them name the same one. - 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 (ARCHITECTURE §26):
federation. Experimental (P8-01): a server whoseexperimental.federationis off refuses it withclose::UNSUPPORTED_PROTOCOL.