Expand description
UDP datagram bridging over HTTP/SSE.
Containers cannot bind host UDP sockets directly. This crate exposes a lease-based HTTP API that lets a containerised process:
- Bind a host UDP port (creating a
UdpBinding). - Receive datagrams via an SSE stream (
GET /v1/udp/recv/{id}). - Send datagrams through the bound socket (
POST /v1/udp/send/{id}). - Heartbeat to extend the lease (
POST /v1/udp/heartbeat/{id}).
Bindings expire after lease_secs without a heartbeat, at which point the
reaper closes the socket. This prevents resource leaks if a container dies.
Follows the same Core/Runtime pattern as koi-health and koi-dns.
Modules§
- http
- HTTP routes for UDP bridging - bind, unbind, recv (SSE), send, status, heartbeat.
Structs§
- Active
Binding - An active UDP binding - owns the socket and a relay task that broadcasts received datagrams to subscribers.
- Binding
Info - Metadata for a live binding (returned by status endpoint).
- UdpBind
Request - Request body for creating a new binding.
- UdpDatagram
- A datagram received on a bound socket, ready to be relayed over SSE.
- UdpRuntime
- Manages UDP socket bindings, datagram relay, and lease reaping.
- UdpSend
Request - Request to send a datagram through a bound socket.