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§
impl Copy for AgentHttp
§impl<'de> Deserialize<'de> for AgentHttp
impl<'de> Deserialize<'de> for AgentHttp
§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
impl Eq for AgentHttp
Source§impl Message for AgentHttp
impl Message for AgentHttp
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.