mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-03 01:39:28 +02:00

Add support for choosing between native-tls and rustls-tls backends through feature flags, with native-tls as the default for maximum platform compatibility. Key changes: - Add mutually exclusive native-tls and rustls-tls feature flags - Use conditional compilation to select TLS implementation - Configure rustls-tls with platform certificate verifier - Refactor to workspace-based dependency management - Update CI workflows with improved cross-compilation support - Add comprehensive TLS backend documentation The native-tls backend uses system TLS libraries (OpenSSL on Linux, Secure Transport on macOS, SChannel on Windows) while rustls-tls provides a pure Rust implementation with platform certificate stores.
21 lines
599 B
Rust
21 lines
599 B
Rust
use futures::StreamExt;
|
|
use librespot_core::SessionConfig;
|
|
use librespot_discovery::DeviceType;
|
|
use sha1::{Digest, Sha1};
|
|
|
|
#[tokio::main(flavor = "current_thread")]
|
|
async fn main() {
|
|
let name = "Librespot";
|
|
let device_id = hex::encode(Sha1::digest(name.as_bytes()));
|
|
|
|
let mut server =
|
|
librespot_discovery::Discovery::builder(device_id, SessionConfig::default().client_id)
|
|
.name(name)
|
|
.device_type(DeviceType::Computer)
|
|
.launch()
|
|
.unwrap();
|
|
|
|
while let Some(x) = server.next().await {
|
|
println!("Received {x:?}");
|
|
}
|
|
}
|