Skip to content

Commit fe9edec

Browse files
Prepare 0.23.0 release
1 parent c1025d5 commit fe9edec

File tree

7 files changed

+19
-29
lines changed

7 files changed

+19
-29
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
# 0.23.0
2+
3+
- Update `tungstenite` to `0.23.0`.
4+
- Disable default features on TLS crates.
5+
16
# 0.22.0
27

38
- Update TLS dependencies.
4-
- Update `tungstenite` to match `0.22.0`.
9+
- ~~Update `tungstenite` to match `0.22.0`.~~
510

611
# 0.21.0
712

Cargo.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ keywords = ["websocket", "io", "web"]
66
authors = ["Daniel Abramov <dabramov@snapview.de>", "Alexey Galakhov <agalakhov@snapview.de>"]
77
license = "MIT"
88
homepage = "https://github.com/snapview/tokio-tungstenite"
9-
documentation = "https://docs.rs/tokio-tungstenite/0.22.0"
9+
documentation = "https://docs.rs/tokio-tungstenite/0.23.0"
1010
repository = "https://github.com/snapview/tokio-tungstenite"
11-
version = "0.22.0"
11+
version = "0.23.0"
1212
edition = "2018"
1313
rust-version = "1.63"
1414
include = ["examples/**/*", "src/**/*", "LICENSE", "README.md", "CHANGELOG.md"]
1515

1616
[package.metadata.docs.rs]
17-
features = ["native-tls", "__rustls-tls"]
17+
all-features = true
1818

1919
[features]
2020
default = ["connect", "handshake"]
@@ -33,7 +33,7 @@ futures-util = { version = "0.3.28", default-features = false, features = ["sink
3333
tokio = { version = "1.0.0", default-features = false, features = ["io-util"] }
3434

3535
[dependencies.tungstenite]
36-
version = "0.21.0"
36+
version = "0.23.0"
3737
default-features = false
3838

3939
[dependencies.native-tls-crate]
@@ -73,7 +73,6 @@ hyper = { version = "1.0", default-features = false, features = ["http1", "serve
7373
hyper-util = { version = "0.1", features = ["tokio"] }
7474
http-body-util = "0.1"
7575
tokio = { version = "1.27.0", default-features = false, features = ["io-std", "macros", "net", "rt-multi-thread", "time"] }
76-
url = "2.3.1"
7776
env_logger = "0.10.0"
7877

7978
[[example]]

examples/autobahn-client.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,26 @@ use tokio_tungstenite::{
44
connect_async,
55
tungstenite::{Error, Result},
66
};
7-
use url::Url;
87

98
const AGENT: &str = "Tungstenite";
109

1110
async fn get_case_count() -> Result<u32> {
12-
let (mut socket, _) = connect_async(
13-
Url::parse("ws://localhost:9001/getCaseCount").expect("Can't connect to case count URL"),
14-
)
15-
.await?;
11+
let (mut socket, _) = connect_async("ws://localhost:9001/getCaseCount").await?;
1612
let msg = socket.next().await.expect("Can't fetch case count")?;
1713
socket.close(None).await?;
1814
Ok(msg.into_text()?.parse::<u32>().expect("Can't parse case count"))
1915
}
2016

2117
async fn update_reports() -> Result<()> {
22-
let (mut socket, _) = connect_async(
23-
Url::parse(&format!("ws://localhost:9001/updateReports?agent={}", AGENT))
24-
.expect("Can't update reports"),
25-
)
26-
.await?;
18+
let (mut socket, _) =
19+
connect_async(&format!("ws://localhost:9001/updateReports?agent={}", AGENT)).await?;
2720
socket.close(None).await?;
2821
Ok(())
2922
}
3023

3124
async fn run_test(case: u32) -> Result<()> {
3225
info!("Running test case {}", case);
33-
let case_url =
34-
Url::parse(&format!("ws://localhost:9001/runCase?case={}&agent={}", case, AGENT))
35-
.expect("Bad testcase URL");
36-
26+
let case_url = &format!("ws://localhost:9001/runCase?case={}&agent={}", case, AGENT);
3727
let (mut ws_stream, _) = connect_async(case_url).await?;
3828
while let Some(msg) = ws_stream.next().await {
3929
let msg = msg?;

examples/client.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ use tokio_tungstenite::{connect_async, tungstenite::protocol::Message};
1818

1919
#[tokio::main]
2020
async fn main() {
21-
let connect_addr =
21+
let url =
2222
env::args().nth(1).unwrap_or_else(|| panic!("this program requires at least one argument"));
2323

24-
let url = url::Url::parse(&connect_addr).unwrap();
25-
2624
let (stdin_tx, stdin_rx) = futures_channel::mpsc::unbounded();
2725
tokio::spawn(read_stdin(stdin_tx));
2826

29-
let (ws_stream, _) = connect_async(url).await.expect("Failed to connect");
27+
let (ws_stream, _) = connect_async(&url).await.expect("Failed to connect");
3028
println!("WebSocket handshake has been successfully completed");
3129

3230
let (write, read) = ws_stream.split();

examples/server-headers.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use tokio_tungstenite::{
1818
Message,
1919
},
2020
};
21-
use url::Url;
2221
#[macro_use]
2322
extern crate log;
2423
use futures_util::{SinkExt, StreamExt};
@@ -69,8 +68,7 @@ async fn accept_connection(stream: TcpStream) {
6968
}
7069

7170
fn client() {
72-
let (mut socket, response) =
73-
connect(Url::parse("ws://localhost:8080/socket").unwrap()).expect("Can't connect");
71+
let (mut socket, response) = connect("ws://localhost:8080/socket").expect("Can't connect");
7472
debug!("Connected to the server");
7573
debug!("Response HTTP code: {}", response.status());
7674
debug!("Response contains the following headers:");

tests/communication.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async fn split_communication() {
8989

9090
con_rx.await.expect("Server not ready");
9191
let tcp = TcpStream::connect("127.0.0.1:12346").await.expect("Failed to connect");
92-
let url = url::Url::parse("ws://localhost:12345/").unwrap();
92+
let url = "ws://localhost:12345/";
9393
let (stream, _) = client_async(url, tcp).await.expect("Client failed to connect");
9494
let (mut tx, _rx) = stream.split();
9595

tests/handshakes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ async fn handshakes() {
2020

2121
rx.await.expect("Failed to wait for server to be ready");
2222
let tcp = TcpStream::connect("127.0.0.1:12345").await.expect("Failed to connect");
23-
let url = url::Url::parse("ws://localhost:12345/").unwrap();
23+
let url = "ws://localhost:12345/";
2424
let _stream = client_async(url, tcp).await.expect("Client failed to connect");
2525
}

0 commit comments

Comments
 (0)