Skip to main content

Module publish_socket

Module publish_socket 

Source
Expand description

Shared spec for user-published host↔guest Unix-socket bridges.

Generalizes the fixed Docker (guest→host) and SSH-agent (host→guest) bridges into a dynamic, user-specified set. The host allocates a vsock port per published socket and encodes the guest-relevant fields into the crate::guest_env::PUBLISH_SOCKETS env var; the guest agent decodes it and starts one relay per entry.

Structs§

PublishedSocket
One published socket, as the guest agent needs to know it: which vsock port carries it, which guest-side path to serve or create, and the direction.

Enums§

SocketDirection
Direction a published Unix socket is bridged.

Functions§

decode
Decode the guest env var back into published-socket specs. Malformed entries are skipped rather than failing the whole parse, so one bad entry can’t take down every bridge.
encode
Encode a list of published sockets for the guest env var, as port|dir|guest_path entries joined by ;. Paths cannot contain ; or | in any realistic case; entries that would are rejected by the host before encoding (see the host-side validator).