2023-05-02 18:05:21 +00:00
|
|
|
use warp::{session, transport};
|
2023-04-14 20:32:02 +00:00
|
|
|
|
|
|
|
use clap::Parser;
|
|
|
|
|
|
|
|
/// Search for a pattern in a file and display the lines that contain it.
|
|
|
|
#[derive(Parser)]
|
|
|
|
struct Cli {
|
|
|
|
/// Listen on this address
|
2023-05-16 17:23:50 +00:00
|
|
|
#[arg(short, long, default_value = "0.0.0.0:4443")]
|
2023-04-14 20:32:02 +00:00
|
|
|
addr: String,
|
|
|
|
|
|
|
|
/// Use the certificate file at this path
|
|
|
|
#[arg(short, long, default_value = "../cert/localhost.crt")]
|
|
|
|
cert: String,
|
|
|
|
|
|
|
|
/// Use the private key at this path
|
|
|
|
#[arg(short, long, default_value = "../cert/localhost.key")]
|
|
|
|
key: String,
|
2023-04-24 17:18:55 +00:00
|
|
|
|
|
|
|
/// Use the media file at this path
|
|
|
|
#[arg(short, long, default_value = "../media/fragmented.mp4")]
|
|
|
|
media: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() -> anyhow::Result<()> {
|
|
|
|
env_logger::init();
|
|
|
|
|
2023-04-14 20:32:02 +00:00
|
|
|
let args = Cli::parse();
|
|
|
|
|
2023-05-02 18:05:21 +00:00
|
|
|
let server_config = transport::Config {
|
2023-04-14 20:32:02 +00:00
|
|
|
addr: args.addr,
|
|
|
|
cert: args.cert,
|
|
|
|
key: args.key,
|
|
|
|
};
|
|
|
|
|
2023-04-24 18:45:46 +00:00
|
|
|
let mut server = transport::Server::<session::Session>::new(server_config).unwrap();
|
2023-04-24 17:18:55 +00:00
|
|
|
server.run()
|
2023-05-02 18:05:21 +00:00
|
|
|
}
|