Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
xOS committed Apr 18, 2022
1 parent 81cbf48 commit f21156b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "realm"
version = "2.1.1"
version = "2.1.2"
authors = ["zhboner <zhboner@gmail.com>"]
edition = "2021"

Expand Down Expand Up @@ -32,7 +32,8 @@ pin-project = "1"
lazy_static = "1"

# transport
kaminari = { version = "0.4.2", optional = true }
kaminari = { version = "0.5.7", optional = true }


# tfo
tokio-tfo = { git = "https://github.com/zephyrchien/tokio-tfo", branch = "main", version = "0.1.9", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions src/conf/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ impl EndpointConf {
) {
None
} else {
let ac = MixAccept::new(MixServerConf {
let ac = MixAccept::new_shared(MixServerConf {
ws: listen_ws,
tls: listen_tls,
});
let cc = MixConnect::new(MixClientConf {
let cc = MixConnect::new_shared(MixClientConf {
ws: remote_ws,
tls: remote_tls,
});
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ pub mod conf;
pub mod utils;
pub mod relay;

pub const VERSION: &str = "2.1.1";
pub const VERSION: &str = "2.1.2";
pub const ENV_CONFIG: &str = "REALM_CONF";
10 changes: 4 additions & 6 deletions src/relay/tcp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cfg_if! {
}

use std::io::Result;

use futures::try_join;
use log::debug;

use tokio::net::TcpSocket;
Expand Down Expand Up @@ -74,12 +74,10 @@ pub async fn connect_and_relay(
#[cfg(feature = "transport")]
{
use kaminari::{AsyncAccept, AsyncConnect};
use kaminari::mix::{MixClientStream, MixServerStream};
type Inbound = MixServerStream<TcpStream>;
type Outbound = MixClientStream<TcpStream>;

if let Some((ac, cc)) = transport {
let mut inbound: Inbound = ac.accept(inbound).await?;
let mut outbound: Outbound = cc.connect(outbound).await?;
let (mut inbound, mut outbound) =
try_join!(ac.accept(inbound), cc.connect(outbound))?;
tokio::io::copy_bidirectional(&mut inbound, &mut outbound)
.await
.map(|_| ())
Expand Down

0 comments on commit f21156b

Please sign in to comment.