Skip to content

Commit

Permalink
docs: update basic echo server and client example (#1649)
Browse files Browse the repository at this point in the history
  • Loading branch information
nycholas authored Mar 29, 2023
1 parent e68c416 commit 5d1426a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ The following implements a basic echo server and client. The client connects to
```rust
// src/bin/server.rs
use s2n_quic::Server;
use std::error::Error;
use std::{error::Error, path::Path};

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let mut server = Server::builder()
.with_tls(("./path/to/cert.pem", "./path/to/key.pem"))?
.with_tls((Path::new("cert.pem"), Path::new("key.pem")))?
.with_io("127.0.0.1:4433")?
.start()?;

Expand Down Expand Up @@ -71,12 +71,12 @@ async fn main() -> Result<(), Box<dyn Error>> {
```rust
// src/bin/client.rs
use s2n_quic::{client::Connect, Client};
use std::{error::Error, net::SocketAddr};
use std::{error::Error, path::Path, net::SocketAddr};

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let client = Client::builder()
.with_tls(CERT_PEM)?
.with_tls(Path::new("cert.pem"))?
.with_io("0.0.0.0:0")?
.start()?;

Expand Down

0 comments on commit 5d1426a

Please sign in to comment.