Skip to content

Commit a778e78

Browse files
committed
Bump version 0.1.11
1 parent 2f99f55 commit a778e78

File tree

2 files changed

+78
-26
lines changed

2 files changed

+78
-26
lines changed

Cargo.toml

Lines changed: 57 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "socks-hub"
3-
version = "0.1.10"
3+
version = "0.1.11"
44
license = "MIT"
55
repository = "https://github.com/ssrlive/socks-hub"
66
homepage = "https://github.com/ssrlive/socks-hub"
@@ -13,29 +13,66 @@ edition = "2021"
1313
crate-type = ["staticlib", "cdylib", "lib"]
1414

1515
[features]
16-
default = ["acl"]
17-
acl = ["idna", "ipnet", "iprange", "once_cell", "regex"]
16+
default = ["sockshub", "acl"]
17+
acl = [
18+
"idna",
19+
"ipnet",
20+
"iprange",
21+
"once_cell",
22+
"regex",
23+
"socks5-impl",
24+
"tokio",
25+
"log",
26+
]
27+
base64 = ["dep:base64"]
28+
sockshub = [
29+
"base64",
30+
"socks5-impl",
31+
"tokio",
32+
"ctrlc2",
33+
"env_logger",
34+
"serde",
35+
"serde_derive",
36+
"serde_json",
37+
"clap",
38+
"chrono",
39+
"http-body-util",
40+
"hyper",
41+
"dotenvy",
42+
"as-any",
43+
"bytes",
44+
"pin-project-lite",
45+
"log",
46+
]
1847

1948
[dependencies]
20-
as-any = "0.3"
21-
base64 = "0.22"
22-
bytes = "1.5"
23-
chrono = "0.4"
24-
clap = { version = "4.5", features = ["derive"] }
25-
ctrlc2 = { version = "3.5", features = ["termination", "tokio"] }
26-
dotenvy = "0.15"
27-
env_logger = "0.11"
28-
http-body-util = "0.1"
29-
hyper = { version = "1.1", features = ["full"] }
49+
as-any = { version = "0.3", optional = true }
50+
base64 = { version = "0.22", optional = true }
51+
bytes = { version = "1.5", optional = true }
52+
cfg-if = "1.0"
53+
chrono = { version = "0.4", optional = true }
54+
clap = { version = "4.5", features = ["derive"], optional = true }
55+
ctrlc2 = { version = "3.5", features = [
56+
"termination",
57+
"tokio",
58+
], optional = true }
59+
dotenvy = { version = "0.15", optional = true }
60+
env_logger = { version = "0.11", optional = true }
61+
http-body-util = { version = "0.1", optional = true }
62+
hyper = { version = "1.1", features = ["full"], optional = true }
3063
idna = { version = "0.5", optional = true }
3164
ipnet = { version = "2.9", optional = true }
3265
iprange = { version = "0.6", optional = true }
33-
log = "0.4"
66+
log = { version = "0.4", optional = true }
3467
once_cell = { version = "1.19", optional = true }
35-
pin-project-lite = { version = "0.2" }
68+
pin-project-lite = { version = "0.2", optional = true }
3669
regex = { version = "1.10", optional = true }
37-
serde = "1.0"
38-
serde_derive = "1.0"
39-
serde_json = "1.0"
40-
socks5-impl = "0.5"
41-
tokio = { version = "1", features = ["full"] }
70+
serde = { version = "1.0", optional = true }
71+
serde_derive = { version = "1.0", optional = true }
72+
serde_json = { version = "1.0", optional = true }
73+
socks5-impl = { version = "0.5", optional = true }
74+
tokio = { version = "1", features = ["full"], optional = true }
75+
76+
[[bin]]
77+
name = "socks-hub"
78+
required-features = ["sockshub", "acl"]

src/lib.rs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
1-
pub mod config;
2-
pub use config::{ArgVerbosity, Config, Credentials, ProxyType};
1+
cfg_if::cfg_if! {
2+
if #[cfg(feature = "base64")] {
3+
mod base64_wrapper;
4+
pub use base64_wrapper::{base64_decode, base64_encode, Base64Engine};
5+
}
6+
}
7+
8+
cfg_if::cfg_if! {
9+
if #[cfg(feature = "acl")] {
10+
mod acl;
11+
pub use acl::AccessControl;
12+
}
13+
}
314

4-
pub mod base64_wrapper;
5-
pub use base64_wrapper::{base64_decode, base64_encode, Base64Engine};
15+
cfg_if::cfg_if! {
16+
if #[cfg(feature = "sockshub")] {
17+
18+
mod config;
19+
pub use config::{ArgVerbosity, Config, Credentials, ProxyType};
620

721
mod tokiort;
822
use tokiort::TokioIo;
923

1024
mod http2socks;
1125
mod socks2socks;
1226

13-
#[cfg(feature = "acl")]
14-
pub mod acl;
1527
mod api;
1628
mod dump_logger;
1729
mod ffi;
@@ -54,3 +66,6 @@ pub(crate) async fn create_s5_connect<A: ToSocketAddrs>(
5466
pub(crate) fn std_io_error_other<E: Into<BoxError>>(err: E) -> std::io::Error {
5567
std::io::Error::new(std::io::ErrorKind::Other, err)
5668
}
69+
70+
}
71+
}

0 commit comments

Comments
 (0)