2023-01-23 18:54:21 +07:00
# dae
2023-02-01 20:32:04 +07:00
< img src = "https://github.com/v2rayA/dae/blob/main/logo.png" border = "0" width = "25%" >
2023-01-24 13:25:21 +07:00
2023-01-23 18:54:21 +07:00
***dae***, means goose, is a lightweight and high-performance transparent proxy solution.
2023-02-04 10:24:03 +07:00
In order to improve the traffic split performance as much as possible, dae runs the transparent proxy and traffic split suite in the linux kernel by eBPF. Therefore, we have the opportunity to make the direct traffic bypass the forwarding by proxy application and achieve true direct traffic through. Under such a magic trick, there is almost no performance loss and additional resource consumption for direct traffic.
2023-01-23 18:54:21 +07:00
2023-02-01 20:32:04 +07:00
As a successor of [v2rayA ](https://github.com/v2rayA/v2rayA ), dae abandoned v2ray-core to meet the needs of users more freely.
2023-01-23 18:54:21 +07:00
2023-02-07 20:54:57 +07:00
**Features**
2023-02-07 21:10:52 +07:00
1. `Real direct` traffic split implementation (need ipforward on) to achieve [high performance ](https://docs.google.com/spreadsheets/d/1UaWU6nNho7edBNjNqC8dfGXLlW0-cm84MM7sH6Gp7UE/edit?usp=sharing ).
2023-02-07 20:54:57 +07:00
1. Split traffic by process name in local host.
1. Split traffic by MAC address in LAN.
1. Split traffic with invert match rules.
1. Automatically switch nodes according to policy.
1. Support full-cone NAT for shadowsocks, vmess, and trojan(-go).
2023-02-01 20:32:04 +07:00
## Usage
2023-02-05 09:29:00 +07:00
### Build
**Make Dependencies**
```
clang >= 10
llvm >= 10
golang >= 1.18
2023-02-05 10:00:29 +07:00
make
2023-02-05 09:29:00 +07:00
```
**Build**
2023-02-01 20:32:04 +07:00
```shell
git clone https://github.com/v2rayA/dae.git
cd dae
git submodule update --init
2023-02-05 09:29:00 +07:00
# Minimal dependency build:
2023-02-05 10:00:29 +07:00
make GOFLAGS="-buildvcs=false" CC=clang
# Or normal build:
2023-02-05 09:29:00 +07:00
# make
2023-02-01 20:32:04 +07:00
```
2023-02-05 09:29:00 +07:00
### Run
**Runtime Dependencies**
Download [geoip.dat ](https://github.com/v2ray/geoip/releases/latest ) and [geosite.dat ](https://github.com/v2fly/domain-list-community/releases/latest ) to `/usr/local/share/dae/` .
```
mkdir -p /usr/local/share/dae/
pushd /usr/local/share/dae/
curl -L -o geoip.dat https://github.com/v2ray/geoip/releases/latest/download/geoip.dat
curl -L -o geosite.dat https://github.com/v2ray/domain-list-community/releases/latest/download/dlc.dat
popd
```
**Run**
2023-02-01 20:32:04 +07:00
```shell
./dae run -c example.dae
```
See [example.dae ](https://github.com/v2rayA/dae/blob/main/example.dae ).
## Linux Kernel Requirement
### Kernel Version
2023-01-31 23:34:39 +07:00
Use `uname -r` to check the kernel version on your machine.
2023-02-04 10:38:01 +07:00
**Bind to LAN: >= 5.8**
2023-01-31 23:34:39 +07:00
You need bind dae to LAN interface, if you want to provide network service for LAN as an intermediate device.
2023-02-04 10:38:01 +07:00
This feature requires the kernel version of machine on which dae install >= 5.8.
2023-01-31 23:34:39 +07:00
Note that if you bind dae to LAN only, dae only provide network service for traffic from LAN, and not impact local programs.
2023-02-04 10:38:01 +07:00
**Bind to WAN: >= 5.8**
2023-01-31 23:34:39 +07:00
You need bind dae to WAN interface, if you want dae to provide network service for local programs.
2023-02-04 10:38:01 +07:00
This feature requires kernel version of the machine >= 5.8.
2023-01-31 23:34:39 +07:00
Note that if you bind dae to WAN only, dae only provide network service for local programs and not impact traffic coming in from other interfaces.
2023-01-24 13:25:21 +07:00
## TODO
2023-01-23 18:54:21 +07:00
2023-01-27 01:10:27 +07:00
1. Check dns upstream and source loop (whether upstream is also a client of us) and remind the user to add sip rule.
2023-02-05 20:05:23 +07:00
2023-01-24 23:31:20 +07:00
1. Domain routing performance optimization.
2023-02-05 20:05:23 +07:00
2023-02-05 09:29:00 +07:00
1. Handle the case that nodes do not support UDP.
2023-02-05 20:05:23 +07:00
2023-02-05 09:29:00 +07:00
1. Handle the case that nodes do not support IPv6.
2023-02-05 20:05:23 +07:00
1. L4Checksum problem.
If the NIC checksumming offload is enabled, the Linux network stack will make a simple checksum a packet when it is sent out from local. When NIC discovers that the source IP of the packet is the local IP of the NIC, it will checksum it complete this checksum.
But the problem is, after the Linux network stack, before entering the network card, we modify the source IP of this packet, causing the Linux network stack to only make a simple checksum, and the NIC also assumes that this packet is not sent from local, so no further checksum completing.
2023-02-01 09:24:11 +07:00
1. MACv2 extension extraction.
2023-02-05 20:05:23 +07:00
2023-02-04 17:27:13 +07:00
1. Log to userspace.
2023-02-05 20:05:23 +07:00
2023-02-06 15:22:07 +07:00
1. DNS upstream support tcp://
2023-01-24 15:27:19 +07:00
1. ...