Skip to content

Commit

Permalink
remove ssl in example
Browse files Browse the repository at this point in the history
  • Loading branch information
yngrtc committed Feb 26, 2024
1 parent ccc0b36 commit d72772d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 17 deletions.
13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,27 @@ data = { path = "rtc/data" }
futures = "0.3.30"

[dev-dependencies]
webrtc = { path = "webrtc/webrtc" }
# sfu impl
clap = { version = "4.4.12", features = ["derive"] }
anyhow = "1.0.78"
wg = "0.7"
thiserror = "1.0.53"
crossbeam-channel = "0.5.11"
ctrlc = "3.4.2"

# str0m impl
str0m = "0.4.1"
tracing-subscriber = { version = "0.3.16", features = ["env-filter", "std"] }
tracing = "0.1.37"
rouille = { version = "3.6.2", features = ["ssl"] }
systemstat = "0.2.2"

# tests
tokio = { version = "1.36.0", features = ["full"] }
tokio-util = "0.7.10"
webrtc = { path = "webrtc/webrtc" }
tokio = { version = "1.36", features = ["full"] }
tokio-util = "0.7"
chrono = "0.4"
env_logger = "0.11"
hyper = { version = "0.14.28", features = ["full"] }
chrono = "0.4.31"
env_logger = "0.10.1"

[[example]]
name = "chat"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ EXPOSE 3478-3495/udp
RUN mkdir -p logs

# Command to run the server
CMD ./target/release/examples/chat -d --level info > ./logs/sfu.log 2>&1 & echo $! > server_pid.txt & cargo test --release --no-fail-fast -- --show-output > ./logs/test.log 2>&1
CMD ./target/release/examples/chat -f -d --level info > ./logs/sfu.log 2>&1 & echo $! > server_pid.txt & cargo test --release --no-fail-fast -- --show-output > ./logs/test.log 2>&1
32 changes: 22 additions & 10 deletions examples/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ pub fn main() -> anyhow::Result<()> {

init_log(cli.debug, cli.level);

let certificate = include_bytes!("cer.pem").to_vec();
let private_key = include_bytes!("key.pem").to_vec();
//let certificate = include_bytes!("str0m_impl/cer.pem").to_vec();
//let private_key = include_bytes!("str0m_impl/key.pem").to_vec();

// Figure out some public IP address, since Firefox will not accept 127.0.0.1 for WebRTC traffic.
let host_addr = if cli.host == "127.0.0.1" && !cli.force_local_loop {
Expand Down Expand Up @@ -128,19 +128,31 @@ pub fn main() -> anyhow::Result<()> {
let media_port_thread_map = Arc::new(media_port_thread_map);
let signal_port = cli.signal_port;
let use_str0m_impl = cli.str0m;
let signal_server = Server::new_ssl(
format!("{}:{}", host_addr, signal_port),
move |request| {
let signal_server = /*if cli.force_local_loop {*/
// for integration test, no ssl
Server::new(format!("{}:{}", host_addr, signal_port), move |request| {
if use_str0m_impl {
web_request_str0m(request, host_addr, media_port_thread_map.clone())
} else {
web_request_sfu(request, media_port_thread_map.clone())
}
},
certificate,
private_key,
)
.expect("starting the signal server");
})
.expect("starting the signal server");
/*} else {
Server::new_ssl(
format!("{}:{}", host_addr, signal_port),
move |request| {
if use_str0m_impl {
web_request_str0m(request, host_addr, media_port_thread_map.clone())
} else {
web_request_sfu(request, media_port_thread_map.clone())
}
},
certificate,
private_key,
)
.expect("starting the signal server")
};*/

let port = signal_server.server_addr().port();
println!("Connect a browser to https://{}:{}", host_addr, port);
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit d72772d

Please sign in to comment.