Skip to content

Commit

Permalink
Example uses authn, not authz
Browse files Browse the repository at this point in the history
  • Loading branch information
pierceforte committed May 22, 2024
1 parent 6436820 commit 8e6b57d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::time::Instant;
async fn main() -> io::Result<()> {
let _ = pretty_env_logger::try_init();

let (_server, mut incoming) = SrtListener::builder().bind(333).await.unwrap();
let (_server, mut incoming) = SrtListener::builder().bind(3333).await.unwrap();

while let Some(request) = incoming.incoming().next().await {
tokio::spawn(async move { handle_request(request).await });
Expand All @@ -40,7 +40,7 @@ async fn handle_request(request: ConnectionRequest) {
};
let mut sender = request.accept(Some(key_settings)).await.unwrap();
let mut stream = stream::iter(
Some(Ok((Instant::now(), Bytes::from("Hello authorized user!!")))).into_iter(),
Some(Ok((Instant::now(), Bytes::from("Hello authenticated user!!")))).into_iter(),
);

sender.send_all(&mut stream).await.unwrap();
Expand Down

0 comments on commit 8e6b57d

Please sign in to comment.