diff --git a/src/main.rs b/src/main.rs index ab4caff..6194d56 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ use tokio_tungstenite::{ connect_async_with_config, tungstenite::{ client::IntoClientRequest, - http::header::{AUTHORIZATION, HeaderValue}, + http::header::{AUTHORIZATION, HeaderValue, USER_AGENT}, Message, }, }; @@ -69,6 +69,11 @@ async fn main() -> Result<(), Box> { request.headers_mut().insert(AUTHORIZATION, auth_value); } + let user_agent = format!("{}/{}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")); + request + .headers_mut() + .insert(USER_AGENT, HeaderValue::from_str(&user_agent).unwrap()); + info!("[{}] Connecting to {}", letter, url); if debug_enabled {