|
| 1 | +## Feature Overview |
| 2 | + |
| 3 | +Relevant source files |
| 4 | + |
| 5 | +- [README.md](https://github.com/daeuniverse/dae/blob/3a846ff2/README.md) |
| 6 | +- [component/outbound/outbound.go](https://github.com/daeuniverse/dae/blob/3a846ff2/component/outbound/outbound.go) |
| 7 | +- [docs/en/proxy-protocols.md](https://github.com/daeuniverse/dae/blob/3a846ff2/docs/en/proxy-protocols.md) |
| 8 | +- [docs/zh/proxy-protocols.md](https://github.com/daeuniverse/dae/blob/3a846ff2/docs/zh/proxy-protocols.md) |
| 9 | + |
| 10 | +This document provides a comprehensive overview of the key features and capabilities of the dae system. It focuses on explaining what dae can do, its major components, and how they interact to deliver a high-performance transparent proxy solution. For detailed implementation information, see [System Architecture](https://deepwiki.com/daeuniverse/dae/1.1-system-architecture). |
| 11 | + |
| 12 | +## Core Capabilities |
| 13 | + |
| 14 | +### Real Direct Traffic Splitting |
| 15 | + |
| 16 | +Dae's most significant feature is its "Real Direct" traffic splitting capability. This allows traffic that doesn't need to be proxied to bypass the proxy application entirely, resulting in: |
| 17 | + |
| 18 | +- Minimal performance loss for direct traffic |
| 19 | +- Reduced resource consumption |
| 20 | +- Improved overall system efficiency |
| 21 | + |
| 22 | +This is achieved through integration with the Linux kernel using eBPF technology, which allows traffic routing decisions to be made at the kernel level. |
| 23 | + |
| 24 | +```text |
| 25 | +Direct TrafficProxy TrafficNetwork TrafficeBPF ProgramsRouting |
| 26 | +DecisionDirect Path |
| 27 | +(Kernel Only)Control PlaneInternetOutbound Connections |
| 28 | +``` |
| 29 | + |
| 30 | +Sources: [README.md14-16](https://github.com/daeuniverse/dae/blob/3a846ff2/README.md#L14-L16) [README.md22](https://github.com/daeuniverse/dae/blob/3a846ff2/README.md#L22-L22) |
| 31 | + |
| 32 | +### Flexible Traffic Routing |
| 33 | + |
| 34 | +Dae provides extensive flexibility in how traffic is routed, allowing users to create sophisticated rules based on: |
| 35 | + |
| 36 | +| Routing Criterion | Description | |
| 37 | +| --- | --- | |
| 38 | +| Domain name | Route based on destination domain | |
| 39 | +| IP address | Route based on destination IP | |
| 40 | +| Protocol | Route based on network protocol (TCP/UDP) | |
| 41 | +| Port | Route based on destination port | |
| 42 | +| Process name | Route based on originating application | |
| 43 | +| MAC address | Route based on client MAC (for LAN clients) | |
| 44 | +| ToS/DSCP | Route based on Type of Service / DSCP value | |
| 45 | + |
| 46 | +These routing options can be combined and customized to create sophisticated routing rules, including support for: |
| 47 | + |
| 48 | +- Inverted matching (routing traffic that doesn't match a pattern) |
| 49 | +- Must-direct rules (forcing traffic to bypass the proxy completely) |
| 50 | +- Block rules (dropping unwanted traffic) |
| 51 | + |
| 52 | +```text |
| 53 | +ActionsRouting Rule OptionsDomain |
| 54 | +MatchingIP |
| 55 | +MatchingProtocol |
| 56 | +MatchingPort |
| 57 | +MatchingProcess |
| 58 | +MatchingMAC |
| 59 | +MatchingToS/DSCP |
| 60 | +MatchingDirect |
| 61 | +RoutingProxy |
| 62 | +RoutingBlock |
| 63 | +ConnectionRouting Rule |
| 64 | +``` |
| 65 | + |
| 66 | +Sources: [README.md21-26](https://github.com/daeuniverse/dae/blob/3a846ff2/README.md#L21-L26) [CHANGELOGS.md516](https://github.com/daeuniverse/dae/blob/3a846ff2/CHANGELOGS.md#L516-L516) |
| 67 | + |
| 68 | +### Node Management and Selection |
| 69 | + |
| 70 | +Dae provides robust capabilities for managing proxy nodes (servers) and selecting the best one based on various criteria: |
| 71 | + |
| 72 | +- Support for multiple node protocols (Shadowsocks, VMess, Trojan, etc.) |
| 73 | +- Node grouping for logical organization |
| 74 | +- Automatic node selection based on: |
| 75 | + - Lowest latency |
| 76 | + - Random selection |
| 77 | + - Fixed node |
| 78 | +- Automatic latency testing for TCP/UDP/IPv4/IPv6 connections |
| 79 | +- Health checking to ensure nodes remain operational |
| 80 | + |
| 81 | +```text |
| 82 | +Node DefinitionProxy |
| 83 | +NodesSubscription |
| 84 | +LinksNode |
| 85 | +GroupsSelection |
| 86 | +PolicyFixed |
| 87 | +NodeRandom |
| 88 | +NodeMin Latency |
| 89 | +NodeHealth |
| 90 | +CheckerLatency |
| 91 | +TestingTCP LatencyUDP LatencyIPv4 LatencyIPv6 Latency |
| 92 | +``` |
| 93 | + |
| 94 | +Sources: [README.md26](https://github.com/daeuniverse/dae/blob/3a846ff2/README.md#L26-L26) [CHANGELOGS.md187-189](https://github.com/daeuniverse/dae/blob/3a846ff2/CHANGELOGS.md#L187-L189) |
| 95 | + |
| 96 | +### Advanced DNS Resolution |
| 97 | + |
| 98 | +DNS handling is a critical component of dae's functionality, offering: |
| 99 | + |
| 100 | +- Customizable DNS resolution paths |
| 101 | +- Support for multiple upstream DNS servers |
| 102 | +- DNS routing based on domain patterns |
| 103 | +- DNS caching to improve performance |
| 104 | +- Prevention of DNS leakage |
| 105 | +- Support for various DNS protocols (DoH, DoT, DoH3, DoQ) |
| 106 | + |
| 107 | +```text |
| 108 | +DNS QueryDNS ControllerDomain MatcherUpstream SelectorDNS Upstream 1DNS Upstream 2DNS Upstream NDNS CacheDNS Response |
| 109 | +``` |
| 110 | + |
| 111 | +Sources: [CHANGELOGS.md142-143](https://github.com/daeuniverse/dae/blob/3a846ff2/CHANGELOGS.md#L142-L143) [README.md27](https://github.com/daeuniverse/dae/blob/3a846ff2/README.md#L27-L27) |
| 112 | + |
| 113 | +### Protocol Support |
| 114 | + |
| 115 | +Dae supports a wide range of proxy protocols including: |
| 116 | + |
| 117 | +- HTTP(S), naiveproxy |
| 118 | +- Socks (4, 4a, 5) |
| 119 | +- VMess/VLESS (with various transport options including Reality) |
| 120 | +- Shadowsocks (AEAD and Stream Ciphers, with plugin support) |
| 121 | +- ShadowsocksR |
| 122 | +- Trojan (trojan-gfw, trojan-go) |
| 123 | +- Tuic (v5) |
| 124 | +- Juicity |
| 125 | +- Hysteria2 |
| 126 | +- Proxy chains (flexible protocol combinations) |
| 127 | + |
| 128 | +```text |
| 129 | +Transport OptionsProxy ProtocolsHTTP(S)Socks (4/4a/5)VMess/VLESSShadowsocksShadowsocksRTrojanTuic v5JuicityHysteria2Proxy ChainTCPWebSocketTLSRealitygRPCMeekHTTP UpgradeWS+TLSsimple-obfsv2ray-plugin |
| 130 | +``` |
| 131 | + |
| 132 | +Sources: [docs/en/proxy-protocols.md](https://github.com/daeuniverse/dae/blob/3a846ff2/docs/en/proxy-protocols.md) [component/outbound/outbound.go](https://github.com/daeuniverse/dae/blob/3a846ff2/component/outbound/outbound.go) |
| 133 | + |
| 134 | +## Network Traffic Flow |
| 135 | + |
| 136 | +Dae processes network traffic through a sophisticated pipeline that ensures optimal routing decisions: |
| 137 | + |
| 138 | +```text |
| 139 | +DirectProxyBlockDirect RuleBlock RuleProxy RuleNetwork TrafficeBPF LayerControl Plane |
| 140 | +DecisionDirect Path |
| 141 | +(Kernel Only)Routing MatcherDrop ConnectionDomain SniffingDNS ControllerDNS ResolutionRouting DecisionNode SelectorOutbound ConnectionInternet |
| 142 | +``` |
| 143 | + |
| 144 | +Sources: [README.md14-20](https://github.com/daeuniverse/dae/blob/3a846ff2/README.md#L14-L20) |
| 145 | + |
| 146 | +## Feature to Code Component Mapping |
| 147 | + |
| 148 | +This diagram shows how dae's features map to the actual code components: |
| 149 | + |
| 150 | +```text |
| 151 | +Core ComponentsUser FeaturesReal Direct Traffic SplitFlexible Traffic RoutingNode ManagementAdvanced DNSProtocol SupportControlPlane |
| 152 | +InterfaceeBPF ManagementRoutingMatcherDnsControllerDialerGroupsBPF MapsTraffic Intercept HooksRulesOptimizerDomain MatcherIP MatcherDNS UpstreamsDNS CacheProtocol DialersNode Health Checker |
| 153 | +``` |
| 154 | + |
| 155 | +Sources: [README.md14-28](https://github.com/daeuniverse/dae/blob/3a846ff2/README.md#L14-L28) [component/outbound/outbound.go](https://github.com/daeuniverse/dae/blob/3a846ff2/component/outbound/outbound.go) |
| 156 | + |
| 157 | +## Additional Features |
| 158 | + |
| 159 | +### System Integration |
| 160 | + |
| 161 | +- **Kernel Interactions**: Configures necessary kernel parameters automatically for optimal performance |
| 162 | +- **Firewall Integration**: Can automatically configure firewalld to ensure compatibility |
| 163 | +- **Network Interface Flexibility**: Supports various interfaces including LAN, WAN, IPIP tunnels, link/ppp, and link/tun |
| 164 | + |
| 165 | +### Administrative Features |
| 166 | + |
| 167 | +- **Service Management**: Can run as a system service with proper lifecycle management |
| 168 | +- **Command Line Interface**: Comprehensive CLI with commands for running, checking, reloading, and suspending |
| 169 | +- **Diagnostics**: Built-in diagnostic tools including latency testing and traffic tracing |
| 170 | +- **Shell Completion**: Support for bash, zsh, and fish shell completion |
| 171 | + |
| 172 | +Sources: [CHANGELOGS.md389-390](https://github.com/daeuniverse/dae/blob/3a846ff2/CHANGELOGS.md#L389-L390) [CHANGELOGS.md575-576](https://github.com/daeuniverse/dae/blob/3a846ff2/CHANGELOGS.md#L575-L576) [CHANGELOGS.md184-186](https://github.com/daeuniverse/dae/blob/3a846ff2/CHANGELOGS.md#L184-L186) |
| 173 | + |
| 174 | +### Performance Features |
| 175 | + |
| 176 | +- **Memory Optimization**: Carefully manages memory usage for efficiency |
| 177 | +- **Connection State Management**: Maintains UDP connection state for better reliability |
| 178 | +- **Health Checking**: Continuous monitoring of proxy node health and connectivity |
| 179 | +- **Bandwidth Control**: Supports configuring bandwidth limitations for connections |
| 180 | + |
| 181 | +Sources: [CHANGELOGS.md143](https://github.com/daeuniverse/dae/blob/3a846ff2/CHANGELOGS.md#L143-L143) [CHANGELOGS.md188-189](https://github.com/daeuniverse/dae/blob/3a846ff2/CHANGELOGS.md#L188-L189) [CHANGELOGS.md645](https://github.com/daeuniverse/dae/blob/3a846ff2/CHANGELOGS.md#L645-L645) |
| 182 | + |
| 183 | +## Feature Evolution |
| 184 | + |
| 185 | +Dae is under active development, with new features being added regularly. Recent additions include: |
| 186 | + |
| 187 | +- Support for Reality protocol (for secure TCP connections) |
| 188 | +- DoH, DoT, DoH3, and DoQ DNS protocols |
| 189 | +- Configurable bandwidth settings |
| 190 | +- MPTCP (Multipath TCP) support |
| 191 | +- Support for various types of network interfaces |
| 192 | + |
| 193 | +For a complete history of feature additions, see [Release History](https://deepwiki.com/daeuniverse/dae/1.3-release-history). |
| 194 | + |
| 195 | +Sources: [CHANGELOGS.md135-189](https://github.com/daeuniverse/dae/blob/3a846ff2/CHANGELOGS.md#L135-L189) |
0 commit comments