Expand description
Native HTTP client using bare metal TCP/IP stack.
This client uses smoltcp over a NetworkDevice driver directly,
bypassing UEFI protocols entirely. Works with any network hardware
that implements the NetworkDevice trait.
§Architecture
┌─────────────────────────────────────────────────────────────┐
│ NativeHttpClient<D> │
│ (HTTP/1.1 request/response, redirects, streaming) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ NetInterface<D> │
│ (TCP sockets, DHCP, IP routing via smoltcp) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ NetworkDevice (VirtIO, Intel, etc.) │
└─────────────────────────────────────────────────────────────┘§Usage
ⓘ
use morpheus_network::client::native::NativeHttpClient;
use morpheus_network::device::virtio::VirtioNetDevice;
use morpheus_network::stack::NetConfig;
// Create device
let device = VirtioNetDevice::new(transport)?;
// Create HTTP client (handles DHCP internally)
let mut client = NativeHttpClient::new(device, NetConfig::dhcp())?;
// Wait for network ready
client.wait_for_network(30_000)?; // 30 second timeout
// Make HTTP request
let response = client.get("http://example.com/file.iso")?;Structs§
- Native HTTP client configuration.
- Native bare-metal HTTP client.
Constants§
- Default timeout for operations (milliseconds).
- Maximum redirects to follow.
- Maximum response size (10GB for ISOs).
Functions§
- Find the end of HTTP headers (\r\n\r\n).
- Parse Content-Length from headers string.