Commit graph

27 commits

Author SHA1 Message Date
B. Blechschmidt
76e0b6fe1d Handle private IP addresses in setup 2023-03-26 11:03:15 +02:00
B. Blechschmidt
2a2b188c75 Make setup argument optional 2023-03-26 00:47:34 +01:00
B. Blechschmidt
4a48b297f3 Restore network configuration on Drop 2023-03-25 21:41:40 +01:00
B. Blechschmidt
1a4a8c4c16 Add auto setup method 2023-03-25 21:12:41 +01:00
B. Blechschmidt
20dc6f78f1 Refactor
This commit moves some essential types to lib and fixes one clippy
warning: https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
2023-03-25 13:07:49 +01:00
ssrlive
ad388f897a refine TunToProxy struct 2023-03-24 09:27:31 +08:00
B. Blechschmidt
6b7f550e7a Enable virtual DNS by default for the CLI.
This commit enables virtual DNS by default for the CLI.

Pros for this decision:
  - It works out of the box in most cases.
  - Users do not need to install third-party software.
  - Users do not need to update their /etc/resolv.conf.

Cons:
  - Not every server might support this.
  - Hijacking port 53 without asking is somewhat intrusive.

Also, make the --dns argument an enum type. In the future, native
support for DNS over TCP/TLS might be added. In that case we could e.g.
supply tcp://1.1.1.1 to the --dns argument without breaking the CLI.
2023-03-23 22:13:35 +01:00
B. Blechschmidt
8be40a1fbd Squashed code beautifications
commit d5fdf845bf
Author: ssrlive <30760636+ssrlive@users.noreply.github.com>
Date:   Thu Mar 23 23:21:22 2023 +0800

    Update tun2proxy.rs

commit 2540daa423
Author: ssrlive <30760636+ssrlive@users.noreply.github.com>
Date:   Thu Mar 23 22:40:26 2023 +0800

    Update main.rs

commit 9ef5efb864
Author: ssrlive <30760636+ssrlive@users.noreply.github.com>
Date:   Thu Mar 23 22:19:06 2023 +0800

    Update main.rs

commit 017ea1a17a
Author: ssrlive <30760636+ssrlive@users.noreply.github.com>
Date:   Thu Mar 23 22:15:00 2023 +0800

    Update main.rs
2023-03-23 18:01:25 +01:00
B. Blechschmidt
5ce3637bde Use dotenvy in main 2023-03-23 13:28:05 +01:00
B. Blechschmidt
c9297124e1 Implement first, unfinished version of DNS support and fix incomplete TCP stream bug
This commit does two things:
First, it implements a first, unfinished version of the virtual DNS
functionality. This feature is incomplete and has known bugs. Since it
needs to be enabled manually, this is not a huge issue so far.
Second, the commit fixes a bug where TCP streams where not properly
relayed, causing TCP connections to stall.
2023-03-23 13:03:01 +01:00
B. Blechschmidt
ca3aadcf1a Use dotenvy instead of unmaintained dotenv and use it for the tests 2023-03-22 18:06:51 +01:00
ssrlive
c82c610c4b .env file support 2023-03-22 17:56:17 +01:00
B. Blechschmidt
e509a81d67 Supply Proxy type to main_entry instead of individual args and adapt test cases 2023-03-22 13:18:07 +01:00
B. Blechschmidt
2f295c3fdc Use Option type for credentials
This commit applys the diff by @ssrlive from
3223ca4e22 (commitcomment-105521241).
2023-03-22 12:18:41 +01:00
B. Blechschmidt
8dd075a7f4 Adapt README to new interface 2023-03-22 12:08:07 +01:00
B. Blechschmidt
3223ca4e22 Pass proxy via URL 2023-03-22 11:17:28 +01:00
B. Blechschmidt
0fb58bec5d Implement HTTP proxy authentication 2023-03-22 02:54:21 +01:00
B. Blechschmidt
d2aef08e3c Implement SOCKS5 authentication 2023-03-22 01:02:27 +01:00
B. Blechschmidt
2f4be7a6cd Run cargo fmt 2023-03-20 17:56:54 +01:00
ssrlive
4ce2bdf0ba separate to lib and exe 2023-03-20 17:28:57 +01:00
ssrlive
7655dee3fb ArgProxyType 2023-03-20 17:52:15 +08:00
ssrlive
ebe91081d4 minor changes 2023-03-20 17:27:28 +08:00
ssrlive
973f7225e8 upgrade clap module 2023-03-20 14:13:06 +08:00
Nikolai Vincent Vaags
c5e95fcc14 Use log for logging 2022-08-16 16:18:25 +02:00
Elvis Gallagher
8d408bbe76 Cleaning and update 2022-08-01 14:36:58 +00:00
B. Blechschmidt
5b6ac8b206 Improve error handling 2021-09-02 21:59:56 +02:00
B. Blechschmidt
6607df83cd Initial commit 2021-09-02 15:02:19 +02:00