Skip to content

Commit 4d97f59

Browse files
committed
Refactoring
1 parent 786f5d7 commit 4d97f59

19 files changed

Lines changed: 80 additions & 109 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/target
2-
Cargo.lock
2+
Cargo.lock
3+
.DS_Store

Cargo.toml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
1-
[workspace]
2-
members = [
3-
"crates/reverseproxy",
4-
"crates/reverseproxy-config",
5-
"crates/reverseproxy-logger",
6-
"crates/reverseproxy-tcp",
7-
"crates/reverseproxy-tor",
8-
"crates/reverseproxy-util",
9-
]
1+
[package]
2+
name = "reverseproxy"
3+
version = "0.1.0"
4+
edition = "2021"
5+
description = "TCP Reverse Proxy written in Rust"
6+
authors = ["Yuki Kishimoto <yukikishimoto@proton.me>"]
7+
homepage = "https://github.com/yukibtc/reverseproxy"
8+
repository = "https://github.com/yukibtc/reverseproxy.git"
9+
license = "MIT"
10+
readme = "README.md"
11+
12+
[features]
13+
default = []
14+
tor = ["libtor"]
15+
16+
[dependencies]
17+
anyhow = "1.0.58"
18+
clap = { version = "3.2.6", features = ["derive"] }
19+
env_logger = "0.9.0"
20+
futures = "0.3.21"
21+
libtor = { version = "47.8.0+0.4.7.x", features=["vendored-openssl"], optional = true }
22+
log = "0.4.14"
23+
rand = "0.8.5"
24+
tokio = { version = "1.19.2", features = ["full"] }
25+
tokio-socks = "0.5.1"
26+
27+
[profile.release]
28+
lto = true
29+
codegen-units = 1

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ clean:
4040
$(Q)cargo clean
4141

4242
loc:
43-
$(Q)echo "--- Counting lines of .rs files (LOC):" && find crates/ -type f -name "*.rs" -exec cat {} \; | wc -l
43+
$(Q)echo "--- Counting lines of .rs files (LOC):" && find src/ -type f -name "*.rs" -exec cat {} \; | wc -l

README.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# TCP Reverse Proxy written in Rust
22

3-
## Install
3+
## Getting started
4+
5+
### Install from [crates.io](https://crates.io/crates/reverseproxy)
6+
7+
```
8+
cargo install reverseproxy
9+
```
10+
11+
### Install from source
412

513
* [Build from source](doc/build.md)
614

@@ -10,24 +18,28 @@ Does NOT support TLS yet!
1018

1119
* Forward from local address to Tor hidden service (.onion) using socks5 proxy
1220

13-
```
14-
reverseproxy 127.0.0.1:8080 torhiddenservice.onion:80 --socks5-proxy 127.0.0.1:9050
15-
```
16-
17-
* Forward from local address to Tor hidden service (.onion) using embedded Tor client (feature in alpha stage)
18-
19-
```
20-
reverseproxy 127.0.0.1:8080 torhiddenservice.onion:80 --use-tor
21-
```
21+
```
22+
reverseproxy 127.0.0.1:8080 torhiddenservice.onion:80 --socks5-proxy 127.0.0.1:9050
23+
```
2224
2325
* Forward from local address to local network address
2426
25-
```
26-
reverseproxy 127.0.0.1:8080 othercomputer.local:80
27-
```
27+
```
28+
reverseproxy 127.0.0.1:8080 othercomputer.local:80
29+
```
2830
2931
To get more info use `reverseproxy --help`
3032
33+
### Experimental
34+
35+
* Forward from local address to Tor hidden service (.onion) using embedded Tor client
36+
37+
To enable this feature, build the binary using `cargo build --release --features tor` or `cargo install --features tor`
38+
39+
```
40+
reverseproxy 127.0.0.1:8080 torhiddenservice.onion:80 --use-tor
41+
```
42+
3143
## License
3244
3345
This project is distributed under the MIT software license - see the [LICENSE](LICENSE) file for details

crates/reverseproxy-config/Cargo.toml

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

crates/reverseproxy-logger/Cargo.toml

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

crates/reverseproxy-tcp/Cargo.toml

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

crates/reverseproxy-tor/Cargo.toml

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

crates/reverseproxy-util/Cargo.toml

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

crates/reverseproxy/Cargo.toml

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

0 commit comments

Comments
 (0)