Skip to main content

AgentHttp

Struct AgentHttp 

Source
pub struct AgentHttp {}
Expand description

—– agent HTTP endpoints data plane —–

AgentHttp namespaces the data plane: workers expose HTTP endpoints served at /agents/{agent_name}/{deployment}/{path} without binding any local listener. The worker opens ONE WebTransport (QUIC) session to /agent that carries both its control stream (the same WorkerMessage/ServerMessage exchange as the WebSocket control connection, length-delimited) and every HTTP exchange: the node opens one bidirectional QUIC stream per request. QUIC provides the multiplexing and per-stream flow control, so there is no credit accounting and no attach handshake.

Each exchange stream is:

[len:u32be][StreamPreamble] the only LiveKit framing [ … opaque bytes … ] one HTTP/1.1 exchange, to FIN or RESET_STREAM

After the preamble the stream is byte-transparent: the node writes a canonical HTTP/1.1 request and the worker replies with an HTTP/1.1 response, each parsed by whatever HTTP implementation the side already has. A WebSocket upgrade is therefore an ordinary request whose response is a 101, after which the stream is a byte pipe. The protocol evolves by version negotiation at registration, so the preamble carries no version of its own.

Bodies use ordinary HTTP/1.1 framing, Content-Length or chunked, and are unbounded: a body may be many gigabytes and must be streamed. Request and response size limits are policy for the layer above.

How one direction ends:

success end of message per the body’s own framing, then FIN. failed mid-body chunked trailer fields x-lk-completion and x-lk-error, in band, so the outcome cannot race the bytes it describes. failed before any RESET_STREAM carrying an HttpStreamResetCode, sound bytes only here, where nothing is in flight.

FIN before the body’s own framing says it is complete is truncation, and a receiver must surface it as such.

The x-lk- header prefix is reserved for this signalling in both directions. A node strips it from client-supplied request headers, so a client cannot forge one, and strips it from responses, so it never reaches the end client.

Trait Implementations§

Source§

impl Clone for AgentHttp

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for AgentHttp

Source§

impl Debug for AgentHttp

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AgentHttp

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for AgentHttp

§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for AgentHttp

Source§

impl Hash for AgentHttp

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Message for AgentHttp

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8> ⓘ
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘ
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for AgentHttp

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
§

impl Serialize for AgentHttp

§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for AgentHttp

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.