diff --git a/Cargo.toml b/Cargo.toml index 1bf6903..e657635 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,27 +15,27 @@ doc-comment = "0.3" envy = { version = "0.4.0", optional = true } hyper-old-types = "0.11.0" isolang = { version = "1.0", features = ["serde_serialize"] } -log = "0.4.6" -reqwest = { version = "0.10.8", default-features = false, features = ["json", "blocking"] } +log = "^0.4" +reqwest = { version = "0.11.4", default-features = false, features = ["json", "blocking", "multipart"] } serde = { version = "1", features = ["derive"] } serde_json = "1" serde_urlencoded = "0.6.1" serde_qs = "0.8.4" url = "2.1.1" tap-reader = "1" -toml = { version = "0.5.0", optional = true } -tungstenite = "0.11.0" +toml = { version = "^0.5.0", optional = true } +tungstenite = "0.15.0" [dependencies.chrono] version = "0.4" features = ["serde"] [features] -default = ["reqwest/default-tls"] +default = ["reqwest/default-tls","tungstenite/native-tls"] json = [] env = ["envy"] all = ["toml", "json", "env"] -rustls-tls = ["reqwest/rustls-tls"] +rustls-tls = ["reqwest/rustls-tls","tungstenite/__rustls-tls"] nightly = [] [dev-dependencies] diff --git a/src/lib.rs b/src/lib.rs index 4c7fb98..f69f17e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -76,7 +76,6 @@ use std::{borrow::Cow, io::BufRead, ops}; use reqwest::blocking::{multipart, Client, RequestBuilder, Response}; use tap_reader::Tap; -use tungstenite::client::AutoStream; use crate::{entities::prelude::*, page::Page}; @@ -90,6 +89,8 @@ pub use crate::{ status_builder::{NewStatus, StatusBuilder}, }; pub use isolang::Language; +use tungstenite::stream::MaybeTlsStream; +use std::net::TcpStream; /// Registering your App pub mod apps; @@ -650,7 +651,7 @@ impl MastodonClient for Mastodon { #[derive(Debug)] /// WebSocket newtype so that EventStream can be implemented without coherency /// issues -pub struct WebSocket(tungstenite::protocol::WebSocket); +pub struct WebSocket(tungstenite::protocol::WebSocket>); /// A type that streaming events can be read from pub trait EventStream {