Skip to content

Commit d5e4bfe

Browse files
committed
allow Client with openssl+proxy
1 parent 335fd49 commit d5e4bfe

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ webpki = { version = "0.21.0", optional = true }
3030
webpki-roots = { version = "^0.19", optional = true }
3131

3232
[features]
33-
default = ["socks", "webpki", "webpki-roots", "rustls"]
33+
default = ["proxy", "use-rustls"]
3434
minimal = []
3535
debug-calls = []
3636
proxy = ["socks"]

src/client.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ use types::*;
1111
/// [`RawClient`](client/struct.RawClient.html) and provides a more user-friendly
1212
/// constructor that can choose the right backend based on the url prefix.
1313
///
14-
/// **This is only available with the `default` features.**
15-
#[cfg(feature = "default")]
14+
/// **This is available only with the `default` features, or if `proxy` and one ssl implementation are enabled**
1615
pub enum Client {
1716
#[doc(hidden)]
1817
TCP(RawClient<ElectrumPlaintextStream>),
@@ -32,7 +31,6 @@ macro_rules! impl_inner_call {
3231
}
3332
}
3433

35-
#[cfg(feature = "default")]
3634
impl Client {
3735
/// Generic constructor that supports multiple backends and, optionally, a socks5 proxy.
3836
///
@@ -70,7 +68,6 @@ impl Client {
7068
}
7169
}
7270

73-
#[cfg(feature = "default")]
7471
impl ElectrumApi for Client {
7572
#[inline]
7673
fn batch_call(&self, batch: Batch) -> Result<Vec<serde_json::Value>, Error> {

src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ extern crate webpki_roots;
4040

4141
mod api;
4242
mod batch;
43+
44+
#[cfg(any(
45+
all(feature = "proxy", feature = "use-openssl"),
46+
all(feature = "proxy", feature = "use-rustls")
47+
))]
4348
pub mod client;
49+
4450
pub mod raw_client;
4551
mod stream;
4652
mod types;

0 commit comments

Comments
 (0)