Skip to content

Commit

Permalink
去除重复代码
Browse files Browse the repository at this point in the history
  • Loading branch information
vnt-dev committed Jun 15, 2024
1 parent 71cf0aa commit 7553391
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 1,463 deletions.
55 changes: 24 additions & 31 deletions vnt-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,11 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
vnt = { path = "../vnt", package = "vnt", default-features = false }
common = { path = "../common" }
getopts = "0.2.21"
console = "0.15.2"
os_info = "3.7.0"
serde = "1.0"
serde_yaml = "0.9.32"
vnt = { path = "../vnt", package = "vnt", default-features = false, features = ["integrated_tun"] }
common = { path = "../common", default-features = false, features = ["integrated_tun"] }
log = "0.4.17"
log4rs = { version = "1.2.0", optional = true }
anyhow = "1.0.82"
[dependencies.uuid]
version = "1.4.1"
features = [
"v4", # Lets you generate random UUIDs
]


[target.'cfg(any(target_os = "linux",target_os = "macos"))'.dependencies]
sudo = "0.6.0"
Expand All @@ -30,24 +20,27 @@ signal-hook = "0.3.17"
winapi = { version = "0.3.9", features = ["handleapi", "processthreadsapi", "winnt", "securitybaseapi", "impl-default"] }

[features]
default = ["vnt/integrated_tun","server_encrypt", "aes_gcm", "aes_cbc", "aes_ecb", "sm4_cbc", "chacha20_poly1305", "ip_proxy", "port_mapping", "log", "command", "file_config", "lz4"]
openssl = ["vnt/openssl"]
openssl-vendored = ["vnt/openssl-vendored"]
ring-cipher = ["vnt/ring-cipher"]
aes_cbc = ["vnt/aes_cbc"]
aes_ecb = ["vnt/aes_ecb"]
sm4_cbc = ["vnt/sm4_cbc"]
aes_gcm = ["vnt/aes_gcm"]
chacha20_poly1305 = ["vnt/chacha20_poly1305"]
server_encrypt = ["vnt/server_encrypt"]
ip_proxy = ["vnt/ip_proxy"]
port_mapping = ["vnt/port_mapping"]
lz4 = ["vnt/lz4_compress"]
zstd = ["vnt/zstd_compress"]
log = ["log4rs"]
command = []
file_config = []
default = ["default-feature"]
default-feature = ["server_encrypt", "aes_gcm", "aes_cbc", "aes_ecb", "sm4_cbc", "chacha20_poly1305", "ip_proxy", "port_mapping", "log", "command", "file_config", "lz4"]

openssl = ["vnt/openssl", "common/openssl"]
openssl-vendored = ["vnt/openssl-vendored", "common/openssl-vendored"]
ring-cipher = ["vnt/ring-cipher", "common/ring-cipher"]
aes_cbc = ["vnt/aes_cbc", "common/aes_cbc"]
aes_ecb = ["vnt/aes_ecb", "common/aes_ecb"]
sm4_cbc = ["vnt/sm4_cbc", "common/sm4_cbc"]
aes_gcm = ["vnt/aes_gcm", "common/aes_gcm"]
chacha20_poly1305 = ["vnt/chacha20_poly1305", "common/chacha20_poly1305"]
server_encrypt = ["vnt/server_encrypt", "common/server_encrypt"]
port_mapping = ["vnt/port_mapping", "common/port_mapping"]
lz4 = ["vnt/lz4_compress", "common/lz4"]
zstd = ["vnt/zstd_compress", "common/zstd"]
ip_proxy = ["vnt/ip_proxy", "common/ip_proxy"]
log = ["common/log"]
command = ["common/command"]
file_config = ["common/file_config"]


[build-dependencies]
embed-manifest = "1.4.0"
rand = "0.8.5"
chrono = "0.4.23"
10 changes: 5 additions & 5 deletions vnt-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ aes_gcm/aes_cbc/aes_ecb/sm4_cbc/chacha20_poly1305/chacha20/xor,默认使用aes

当地址解析失败时,会依次尝试后面的dns,直到有A记录、AAAA记录(或TXT记录)的解析结果

### --mapping `<udp:0.0.0.0:80->10.26.0.10:80>`
### --mapping `<udp:0.0.0.0:80-10.26.0.10:80>`

端口映射,可以设置多个映射地址,例如 '--mapping udp:0.0.0.0:80->10.26.0.10:80 --mapping tcp:0.0.0.0:80->10.26.0.11:81'
端口映射,可以设置多个映射地址,例如 '--mapping udp:0.0.0.0:80-10.26.0.10:80 --mapping tcp:0.0.0.0:80-10.26.0.11:81'
表示将本地udp 80端口的数据转发到10.26.0.10:80,将本地tcp 80端口的数据转发到10.26.0.11:81,转发的目的地址可以使用域名+端口

### --compressor `<lz4>`
Expand Down Expand Up @@ -198,9 +198,9 @@ dns:
- 223.5.5.5 # 首选dns
- 8.8.8.8 # 备选dns
mapping:
- udp:0.0.0.0:80->10.26.0.10:80 # 映射udp数据
- tcp:0.0.0.0:80->10.26.0.10:81 # 映射tcp数据
- tcp:0.0.0.0:82->localhost:83 # 映射tcp数据
- udp:0.0.0.0:80-10.26.0.10:80 # 映射udp数据
- tcp:0.0.0.0:80-10.26.0.10:81 # 映射tcp数据
- tcp:0.0.0.0:82-localhost:83 # 映射tcp数据
```
或者需要哪个配置就加哪个,当然token是必须的
Expand Down
16 changes: 0 additions & 16 deletions vnt-cli/build.rs

This file was deleted.

53 changes: 0 additions & 53 deletions vnt-cli/src/callback.rs

This file was deleted.

81 changes: 0 additions & 81 deletions vnt-cli/src/command/client.rs

This file was deleted.

46 changes: 0 additions & 46 deletions vnt-cli/src/command/entity.rs

This file was deleted.

Loading

0 comments on commit 7553391

Please sign in to comment.