B. Blechschmidt
d4127af422
Add DNS hint
Virtual DNS intercepts the DNS queries generated by the machine. This
requires that the queries are actually sent through the tunnel
interface. In some scenarios, this is not automatically the case, for
example when `/etc/resolv.conf` contains a `nameserver` entry with some
local IP address for which there is a route through the ethernet
interface. A special-purpose IP address like 198.18.0.1 is unlikely to
be inside another route than the default route and can be used to force
DNS resolution through the tunnel.
3 years ago
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
3 years ago
B. Blechschmidt
e6e6c70006
Fix formatting
IPv6 addresses without ports are not enclosed in brackets. They only get
enclosed in brackets in combination with a port.
3 years ago
ssrlive
d4410264e6
refine code
3 years ago
B. Blechschmidt
ce8ecbe44e
Fix CI
3 years ago
B. Blechschmidt
a5aac8c0a4
Merge SOCKS4 support
The SOCKS4 tests in the CI pipeline will currently fail, as no SOCKS4
test server for automated testing has been set up yet.
3 years ago
B. Blechschmidt
341bab5586
Implement SOCKS4
3 years ago
B. Blechschmidt
c8e1872efe
Add configuration notes
3 years ago
ssrlive
197b1c83a4
use thiserror to make error handler simple
3 years ago
ssrlive
bfa1bbc462
switch to smoltcp dev version
to support IpProtocol with Hash trait
3 years ago
B. Blechschmidt
4eddcfd02b
Fix code style
3 years ago
B. Blechschmidt
8135ed3dce
Handle poll interrupt gracefully
3 years ago
B. Blechschmidt
280073ebfe
Fix test framework
3 years ago
B. Blechschmidt
5930b9b3b1
Merge improved error handling from ssrlive
3 years ago
B. Blechschmidt
83846fe631
Make virtual DNS more robust
3 years ago
B. Blechschmidt
3c8005e6b7
Use LRU cache for virtual DNS
This commit introduces an LRU cache for virtual DNS and fixes a bug
where the virtual DNS feature would cause connection mappings to time
out.
3 years ago
ssrlive
31e8d4791e
remove s2e function
3 years ago
ssrlive
0fd5d85155
clean code
3 years ago
ssrlive
1d1e50c36a
remove lots of unwrap()
3 years ago
ssrlive
ad388f897a
refine TunToProxy struct
3 years ago
B. Blechschmidt
7dec7f59f1
Add some TODOs
3 years ago
B. Blechschmidt
7d3e37b1d9
Explain DNS feature in README
3 years ago
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.
3 years ago
B. Blechschmidt
7695ba9c39
Increase DNS implementation robustness
3 years ago
B. Blechschmidt
846375a7d3
Improve readability of IP addresses
3 years ago
B. Blechschmidt
5295721461
Enable logging in tests
3 years ago
B. Blechschmidt
8be40a1fbd
Squashed code beautifications
commit d5fdf845bf
Author: ssrlive <[email protected] >
Date: Thu Mar 23 23:21:22 2023 +0800
Update tun2proxy.rs
commit 2540daa423
Author: ssrlive <[email protected] >
Date: Thu Mar 23 22:40:26 2023 +0800
Update main.rs
commit 9ef5efb864
Author: ssrlive <[email protected] >
Date: Thu Mar 23 22:19:06 2023 +0800
Update main.rs
commit 017ea1a17a
Author: ssrlive <[email protected] >
Date: Thu Mar 23 22:15:00 2023 +0800
Update main.rs
3 years ago
B. Blechschmidt
d13c7ff61b
Add DNS tests
3 years ago
ssrlive
32403c5423
remove the From implement
3 years ago
B. Blechschmidt
e3e402d8ce
Update .gitignore
3 years ago
B. Blechschmidt
5ce3637bde
Use dotenvy in main
3 years ago
B. Blechschmidt
4260e28a52
Improve code style
3 years ago
B. Blechschmidt
3de8b992d4
Merge branch 'ssrlive' into dns-robustness
3 years ago
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.
3 years ago
ssrlive
d4eed896bb
SocketAddr issues
3 years ago
ssrlive
6fe44f8055
IpProtocol values
3 years ago
ssrlive
4af656039e
refine code
3 years ago
B. Blechschmidt
56d0dd9d42
Fix SOCKS5 domain name address type sending
3 years ago
B. Blechschmidt
1a5eeece6f
Prepare DNS support
3 years ago
B. Blechschmidt
ca3aadcf1a
Use dotenvy instead of unmaintained dotenv and use it for the tests
3 years ago
ssrlive
c82c610c4b
.env file support
3 years ago
B. Blechschmidt
3e33244e26
Do not leak secret
3 years ago
B. Blechschmidt
9ae74f10f6
Fix port in README
3 years ago
B. Blechschmidt
4aba996b64
Reflect authentication support in README
3 years ago
ssrlive
e637a55e6a
move error handler to a separate module
3 years ago
B. Blechschmidt
5cbb13247f
Run tests with GitHub actions
3 years ago
B. Blechschmidt
e509a81d67
Supply Proxy type to main_entry instead of individual args and adapt test cases
3 years ago
B. Blechschmidt
2f295c3fdc
Use Option type for credentials
This commit applys the diff by @ssrlive from
3223ca4e22 (commitcomment-105521241) .
3 years ago
B. Blechschmidt
8dd075a7f4
Adapt README to new interface
3 years ago
B. Blechschmidt
5df3877042
Merge branch 'ssrlive' into auth
3 years ago