| Server | Client |
|---|---|
| ```rust #[tokio::main] async fn main() -> Result<()> { let config = ServerConfig::builder() .with_bind_default(4433) .with_identity(&identity) .build(); let connection = Endpoint::server(config)? .accept() .await // Awaits connection .await? // Awaits session request .accept() // Accepts request .await?; // Awaits ready session let stream = connection.accept_bi().await?; // ... } ``` | ```rust #[tokio::main] async fn main() -> Result<()> { let config = ClientConfig::default(); let connection = Endpoint::client(config)? .connect("https://[::1]:4433") .await?; let stream = connection.open_bi().await?.await?; // ... } ``` |