Skip to content

Commit

Permalink
feat: do not depends on extra http_shim crate
Browse files Browse the repository at this point in the history
  • Loading branch information
PrivateRookie committed Dec 3, 2023
1 parent da9b314 commit f4d0078
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 235 deletions.
15 changes: 9 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
package.version = "0.10.3"
members = [".", "ffi/py", "http_shim"]
package.version = "0.10.4"
members = [".", "ffi/py"]

[package]
name = "ws-tool"
Expand All @@ -24,7 +24,8 @@ keywords = ["websocket", "proxy", "network"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
http_shim = { path = "http_shim", optional = true, version = "0.0.1" }
http1_x = { package = "http", version = "1", optional = true }
http0_x = { package = "http", version = "0.2", optional = true }
thiserror = "1"
rand = "0.8"
base64 = "0.20"
Expand Down Expand Up @@ -59,7 +60,7 @@ hyper-util = { version = "0.1", optional = true }


[features]
default = ["sync", "simple", "sync_tls_rustls", "http_shim/old"]
default = ["sync", "simple", "sync_tls_rustls", "http_old"]
sync = []
sync_tls_rustls = ["sync", "rustls-connector", "rustls-pemfile"]
sync_tls_native = ["sync", "native-tls"]
Expand All @@ -76,9 +77,11 @@ async_tls_native = ["async", "tokio-native-tls"]
deflate = ["libz-sys"]
deflate_static = ["libz-sys/static"]
deflate_ng = ["libz-sys/zlib-ng"]
poem = ["dep:poem", "async", "http_shim/old"]
axum = ["dep:axum", "dep:hyper", "dep:hyper-util", "async", "http_shim/new"]
poem = ["dep:poem", "async", "http_old"]
axum = ["dep:axum", "dep:hyper", "dep:hyper-util", "async", "http_new"]
simple = ["deflate"]
http_old = ["dep:http0_x"]
http_new = ["dep:http1_x"]


[dev-dependencies]
Expand Down
19 changes: 0 additions & 19 deletions http_shim/Cargo.toml

This file was deleted.

201 changes: 0 additions & 201 deletions http_shim/LICENSE

This file was deleted.

8 changes: 0 additions & 8 deletions http_shim/src/lib.rs

This file was deleted.

3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

use std::collections::HashMap;

pub use http_shim as http;
mod shim;
pub use shim::http;

/// websocket error definitions
pub mod errors;
Expand Down
8 changes: 8 additions & 0 deletions src/shim.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#[cfg(all(feature = "http_old", not(feature = "http_new")))]
pub use http0_x as http;

#[cfg(all(feature = "http_new", feature = "http_old"))]
pub use http0_x as http;

#[cfg(all(feature = "http_new", not(feature = "http_old")))]
pub use http1_x as http;

0 comments on commit f4d0078

Please sign in to comment.