Skip to content

Commit 90ab002

Browse files
committed
refactor: move access server to protocol
1 parent 5980451 commit 90ab002

18 files changed

Lines changed: 44 additions & 77 deletions

File tree

Cargo.lock

Lines changed: 10 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[workspace]
22
resolver = "2"
33
members = [
4-
"access_server",
54
"common",
65
"protocol",
76
"server",

access_server/Cargo.toml

Lines changed: 0 additions & 26 deletions
This file was deleted.

access_server/src/stream/mod.rs

Lines changed: 0 additions & 1 deletion
This file was deleted.

access_server/src/stream/streams/mod.rs

Lines changed: 0 additions & 1 deletion
This file was deleted.

protocol/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,16 @@ tokio_kcp = { workspace = true }
2525
tracing = { workspace = true }
2626
udp_listener = { workspace = true }
2727

28+
bytes = { workspace = true }
29+
futures = { workspace = true }
30+
http-body-util = { workspace = true }
31+
hyper = { workspace = true, features = ["full"] }
32+
hyper-util = { workspace = true, features = ["tokio"] }
33+
monitor_table = { workspace = true }
34+
pin-project-lite = { workspace = true }
35+
regex = { workspace = true }
36+
tokio-util = { workspace = true }
37+
tracing-subscriber = { workspace = true }
38+
2839
[dev-dependencies]
2940
serde_json = { workspace = true }
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
use std::{collections::HashMap, sync::Arc};
22

3+
use crate::{
4+
socks5::server::{
5+
tcp::{Socks5ServerTcpAccessConnHandler, Socks5ServerTcpAccessServerConfig},
6+
udp::{Socks5ServerUdpAccessConnHandler, Socks5ServerUdpAccessServerConfig},
7+
},
8+
stream::streams::{
9+
http_tunnel::{HttpAccessConnHandler, HttpAccessServerConfig},
10+
tcp::access_server::{TcpAccessConnHandler, TcpAccessServerConfig},
11+
},
12+
udp::access_server::{UdpAccessConnHandler, UdpAccessServerConfig},
13+
};
314
use common::{
415
config::{Merge, merge_map},
516
error::{AnyError, AnyResult},
@@ -16,21 +27,9 @@ use common::{
1627
},
1728
},
1829
};
19-
use protocol::{
20-
stream::streams::tcp::access_server::{TcpAccessConnHandler, TcpAccessServerConfig},
21-
udp::access_server::{UdpAccessConnHandler, UdpAccessServerConfig},
22-
};
2330
use serde::{Deserialize, Serialize};
24-
use socks5::server::{
25-
tcp::{Socks5ServerTcpAccessConnHandler, Socks5ServerTcpAccessServerConfig},
26-
udp::{Socks5ServerUdpAccessConnHandler, Socks5ServerUdpAccessServerConfig},
27-
};
28-
use stream::streams::http_tunnel::{HttpAccessConnHandler, HttpAccessServerConfig};
2931
use tokio_util::sync::CancellationToken;
3032

31-
pub mod socks5;
32-
pub mod stream;
33-
3433
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3534
#[serde(deny_unknown_fields)]
3635
pub struct AccessServerStream {

protocol/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
pub mod access_server;
12
pub mod proxy_server;
3+
pub mod socks5;
24
pub mod stream;
35
pub mod udp;
File renamed without changes.

0 commit comments

Comments
 (0)