Skip to content

Commit 77c591c

Browse files
committed
Rename the project to tls-proxy-tunnel to avoid name clashing
This project was rename to tls-proxy-tunnel to be clear that this projct is a different project the the one from which I forked it. Thanks to Jacob for his great cooperation.
1 parent 9e988a4 commit 77c591c

File tree

9 files changed

+50
-141
lines changed

9 files changed

+50
-141
lines changed

.drone.jsonnet

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

Cargo.lock

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

Cargo.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
[package]
2-
name = "layer4-proxy"
3-
version = "0.7.1"
2+
name = "tls-proxy-tunnel"
3+
version = "1.0.1"
44
edition = "2021"
5-
authors = ["Aleksandar Lazic <al-git001@none.at>","Jacob Kiers <code@kiers.eu>"]
5+
authors = ["Aleksandar Lazic <al-git001@none.at>"]
66
license = "Apache-2.0"
7-
description = "Simple and fast layer 4 proxy in Rust"
7+
description = "Simple and fast TLS-Proxy tunnel in Rust"
88
readme = "README.md"
9-
homepage = "https://github.com/git001/layer4-proxy-rs"
10-
repository = "https://github.com/git001/layer4-proxy-rs"
9+
homepage = "https://github.com/git001/tls-proxy-tunnel"
10+
repository = "https://github.com/git001/tls-proxy-tunnel"
1111
keywords = ["proxy", "network"]
1212
categories = ["web-programming"]
13+
publish = false
1314

1415
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1516

1617
exclude = [".*"]
1718

1819
[[bin]]
19-
name = "layer4-proxy"
20+
name = "tls-proxy-tunnel"
2021
path = "src/main.rs"
2122

2223
[dependencies]

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN set -x \
77
&& apk upgrade --no-cache \
88
&& apk add --no-cache bash bash-completion curl bind-tools gcc musl-dev \
99
&& cargo install --path . \
10-
&& mv /usr/local/cargo/bin/layer4-proxy /usr/local/bin/layer4-proxy \
10+
&& mv /usr/local/cargo/bin/tls-proxy-tunnel /usr/local/bin/tls-proxy-tunnel \
1111
&& apk del --no-cache gcc musl-dev \
1212
&& rm -rf /var/cache/apk/* /usr/src /usr/local/rustup /usr/local/cargo/
1313

@@ -20,4 +20,4 @@ COPY container-files /
2020

2121
WORKDIR /tmp
2222

23-
CMD ["/usr/local/bin/layer4-proxy"]
23+
CMD ["/usr/local/bin/tls-proxy-tunnel"]

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# layer4-proxy
1+
# tls-proxy-tunnel
22

33
> Hey, now we are on level 4!
44
55

6-
`layer4-proxy` is a layer 4 proxy implemented by Rust to listen on specific ports and transfer TCP data to remote addresses (only TCP) according to the configuration.
6+
`tls-proxy-tunnel` is a layer 4 proxy implemented by Rust to listen on specific ports and transfer TCP data to remote addresses (only TCP) via a HTTP Proxy according to the configuration.
77

88
## Features
99

@@ -21,11 +21,11 @@
2121
sequenceDiagram
2222
2323
participant CL AS Client
24-
participant LP AS Layer4 Proxy
24+
participant LP AS TLS-Proxy Tunnel
2525
participant UP AS Upstream Proxy
2626
participant DS AS Destination Server
2727
28-
CL->>LP: Connect to Layer4 Proxy via TCP<br/>SNI is used for routing
28+
CL->>LP: Connect to TLS-Proxy Tunnel via TCP<br/>SNI is used for routing
2929
LP->>UP: Connect to Upstream Proxy via TCP
3030
LP->>UP: Send "CONNECT" and some other<br/>Upstream Proxy header
3131
UP->>DS: Connect to Destination Server
@@ -41,23 +41,23 @@ sequenceDiagram
4141
To gain best performance on your computer's architecture, please consider build the source code. First, you may need [Rust tool chain](https://rustup.rs/).
4242

4343
```bash
44-
$ cd layer4-proxy
44+
$ cd tls-proxy-tunnel
4545
$ cargo build --release
4646
```
4747

48-
Binary file will be generated at `target/release/layer4-proxy`, or you can use `cargo install --path .` to install.
48+
Binary file will be generated at `target/release/tls-proxy-tunnel`, or you can use `cargo install --path .` to install.
4949

50-
Or you can use Cargo to install `layer4-proxy`:
50+
Or you can use Cargo to install `tls-proxy-tunnel`:
5151

5252
```bash
53-
$ cargo install layer4-proxy
53+
$ cargo install tls-proxy-tunnel
5454
```
5555

5656
Or you can download binary file form the Release page.
5757

5858
## Configuration
5959

60-
`layer4-proxy` will read yaml format configuration file from `/etc/l4p/l4p.yaml`, and you can set custom path to environment variable `L4P_CONFIG`, here is an minimal viable example:
60+
`tls-proxy-tunnel` will read yaml format configuration file from `/etc/tpt/tpt.yaml`, and you can set custom path to environment variable `tpt_CONFIG`, here is an minimal viable example:
6161

6262
```yaml
6363
version: 1
@@ -67,7 +67,7 @@ via: &viaanchor
6767
target: www.test1.com
6868
headers:
6969
Host: www.test1.com
70-
Proxy-Authorization: basic ${ENCODED_PW}
70+
Proxy-Authorization: Basic ${ENCODED_PW}
7171
Proxy-KeepAlive: true
7272

7373
servers:
@@ -96,14 +96,14 @@ For detailed configuration, check [this example](./config.yaml.example).
9696
## Test run
9797
9898
```shell
99-
L4P_CONFIG=container-files/etc/l4p/config.yaml cargo run
99+
TPT_CONFIG=container-files/etc/tpt/config.yaml cargo run
100100
```
101101

102102
## Thanks
103103

104-
- [`l4p`](https://crates.io/crates/`l4p`), of which this is a heavily modified fork.
104+
- [`fourth`](https://crates.io/crates/fourth), of which this is a heavily modified fork.
105105
- [`layer4-proxy`](https://code.kiers.eu/jjkiers/layer4-proxy)
106106

107107
## License
108108

109-
`layer4-proxy` is available under terms of Apache-2.0.
109+
`tls-proxy-tunnel` (`tpt`) is available under terms of Apache-2.0.

src/config/config_v1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ fn load_config(path: &str) -> Result<ParsedConfigV1, ConfigError> {
133133

134134
let log_level = base.log.clone().unwrap_or_else(|| "info".to_string());
135135
if !log_level.eq("disable") {
136-
std::env::set_var("FOURTH_LOG", log_level.clone());
136+
std::env::set_var("TPT_LOG", log_level.clone());
137137
env_logger::builder().default_format().init();
138-
//pretty_env_logger::init_custom_env("FOURTH_LOG");
138+
//pretty_env_logger::init_custom_env("TPT_LOG");
139139
//pretty_env_logger::init_timed();
140140
}
141141

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ fn main() {
4141
}
4242

4343
fn find_config() -> Result<String, Vec<String>> {
44-
let possible_locations = ["/etc/l4p", ""];
45-
let possible_names = ["l4p.yaml", "config.yaml"];
44+
let possible_locations = ["/etc/tpt", ""];
45+
let possible_names = ["tpt.yaml", "config.yaml"];
4646

4747
let mut tried_paths = Vec::<String>::new();
4848
let mut possible_paths = Vec::<PathBuf>::new();
4949

50-
if let Ok(env_path) = std::env::var("L4P_CONFIG") {
50+
if let Ok(env_path) = std::env::var("TPT_CONFIG") {
5151
possible_paths.push(PathBuf::from(env_path));
5252
}
5353

l4p.service renamed to tpt.service

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Unit]
2-
Description=l4p - Layer 4 proxy
2+
Description=tpt - TLS-Proxy Tunnel
33

44
After=network-online.target
55
Wants=network-online.target
@@ -11,9 +11,9 @@ WantedBy=default.target
1111
Type=simple
1212

1313
# Allow read-only access to the config directory
14-
ReadOnlyPaths=/etc/l4p
14+
ReadOnlyPaths=/etc/tpt
1515
# Path to the binary
16-
ExecStart=/usr/local/bin/layer4-proxy
16+
ExecStart=/usr/local/bin/tls-proxy-tunnel
1717

1818
# Needs CAP_NET_BIND_SERVICE in order to bind to lower ports
1919
# When using ports above 1024, these should be made empty

0 commit comments

Comments
 (0)