send user agent
This commit is contained in:
@@ -9,7 +9,7 @@ use tokio_tungstenite::{
|
|||||||
connect_async_with_config,
|
connect_async_with_config,
|
||||||
tungstenite::{
|
tungstenite::{
|
||||||
client::IntoClientRequest,
|
client::IntoClientRequest,
|
||||||
http::header::{AUTHORIZATION, HeaderValue},
|
http::header::{AUTHORIZATION, HeaderValue, USER_AGENT},
|
||||||
Message,
|
Message,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -69,6 +69,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
request.headers_mut().insert(AUTHORIZATION, auth_value);
|
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);
|
info!("[{}] Connecting to {}", letter, url);
|
||||||
|
|
||||||
if debug_enabled {
|
if debug_enabled {
|
||||||
|
|||||||
Reference in New Issue
Block a user