Commit Graph
339 Commits
Author SHA1 Message Date
wwqgtxx 98f1200d0d fix: panic when UDP is not supported in dns_dialer 2026-07-30 09:18:40 +08:00
Peter Solomon ea19cda0c9 feat: add rematch outbound type and REMATCH-NAME rule type (#2862) 2026-06-12 22:13:32 +08:00
ECHSFXY fd2112ecbe feat: add built-in proxy PASS-RULE (#2873)
when a PASS-RULE is hit in a sub-rule, the sub-rule will not be skipped; instead, the currently hit rule branch will be skipped, and the matching of rules will continue in the sub-rule.
2026-06-04 21:23:39 +08:00
wwqgtxx a05c94b4ad chore: make the proxydialer module no longer directly depend on the tunnel module 2026-05-17 21:55:16 +08:00
wwqgtxx 17bed79b41 fix: tsnet panic for tailscale 2026-05-15 18:13:04 +08:00
汐殇 571925d2d2 feat: add Tailscale outbound support (#2786) 2026-05-14 12:47:05 +08:00
wwqgtxx ffe6e42cfa fix: conn maybe not closed in error handling 2026-05-09 09:53:40 +08:00
wwqgtxx 0c995a2479 chore: move proxiesWithProviders to hub/route internal to disallow external usage of this poorly implemented function 2026-01-17 22:26:14 +08:00
wwqgtxx 10f4bebdfa fix: only clear dstIP if it is confirmed to be a fake IP 2025-12-30 17:16:09 +08:00
wwqgtxx 6539b509cb chore: restful api contains providerChains for connections 2025-12-04 17:29:01 +08:00
wwqgtxx d8dcaa7500 chore: add upTotal and downTotal data to /traffic restful api 2025-12-03 11:31:13 +08:00
wwqgtxx 140d892ccf chore: better log 2025-11-22 20:59:53 +08:00
wwqgtxx 1d5890abc1 chore: cleanup import path for constant/provider 2025-11-06 19:32:12 +08:00
wwqgtxx a3c023ae3e chore: cleanup import path for component/process 2025-11-06 19:27:40 +08:00
wwqgtxx c8af92a01f feat: support fake-ip-range6 in dns module 2025-10-28 11:40:00 +08:00
wwqgtxx 0992ee8adf chore: remove depend of gopsutil 2025-09-24 02:21:47 +08:00
wwqgtxx aa555ced5f chore: allow embedded xsync.Map to be lazily initialized 2025-07-15 17:33:36 +08:00
wwqgtxx 349b773b40 chore: upgrade and embed the xsync.Map to v4 2025-07-15 13:39:03 +08:00
wwqgtxx 85bb40aaf8 chore: add Int32Enum for common/atomic 2025-06-12 15:24:29 +08:00
wwqgtxx 082bcec281 chore: apply find process mode in direct/global mode 2025-06-12 00:27:51 +08:00
wwqgtxx ae7967f662 chore: the resolve and findProcess behaviors of Logic and SubRules follow the order and needs of the internal rules 2025-06-10 20:11:50 +08:00
wwqgtxx c0f452b540 chore: more unmap for 4in6 address 2025-05-29 10:14:06 +08:00
wwqgtxx 60ae9dce56 chore: recover log leval for preHandleMetadata 2025-05-27 18:10:44 +08:00
wwqgtxx a1c7881229 chore: rebuild udp dns resolve
The DNS resolution of the overall UDP part has been delayed to the connection initiation stage. During the rule matching process, it will only be triggered when the IP rule without no-resolve is matched.

For direct and wireguard outbound, the same logic as the TCP part will be followed, that is, when direct-nameserver (or DNS configured by wireguard) exists, the result of the matching process will be discarded and the domain name will be re-resolved. This re-resolution logic is only effective for fakeip.

For reject and DNS outbound, no resolution is required.

For other outbound, resolution will still be performed when the connection is initiated, and the domain name will not be sent directly to the remote server at present.
2025-05-27 10:45:26 +08:00
wwqgtxx 12e3952b74 chore: code cleanup 2025-05-26 12:33:24 +08:00
wwqgtxx 88419cbd12 chore: better parse remote dst 2025-05-26 01:12:35 +08:00
wwqgtxx 4ed830330e chore: remove confused code 2025-05-25 22:22:23 +08:00
wwqgtxx 7e7016b567 chore: removed routing-mark and interface-name of the group, please set it directly on the proxy instead 2025-05-01 02:13:35 +08:00
wwqgtxx 7ff046a455 chore: modify UDPSniff's function signature to prepare for its ability to handle multiple packets. 2025-03-13 08:52:27 +08:00
J.K.SAGE 49d54cc293 fix: remote conn statistic error (#1776)
TCP handshake traffic should be counted as upload traffic for the remote connection
2025-01-07 13:23:05 +08:00
wwqgtxx 269c52575c chore: update gopsutil to v4 2024-12-14 11:09:51 +08:00
wwqgtxx ce52c3438b chore: cleaned up some confusing code 2024-11-05 10:03:21 +08:00
xishang0128 57725078e0 chore: Adjust the error log for the search process 2024-10-11 07:35:51 +08:00
wwqgtxx 990de84391 chore: better atomic using 2024-10-02 14:45:06 +08:00
wwqgtxx 43cb48231a cache: add dns cache in udp packet sender
reduce the cost of re-resolving DNS for each packet received and prevent the target IP from jumping between multiple resolution results
2024-09-26 22:21:59 +08:00
wwqgtxx 4fa15c6334 chore: ensures packets can be sent without blocking the tunnel 2024-09-26 11:21:07 +08:00
wwqgtxx 5812a7bdeb chore: simplify the code 2024-09-25 21:37:15 +08:00
HamsterReservedandHamster Tian 3922b17067 chore: deliver UDP packets from same connection in receiving order (#1540)
All UDP packets are queued into a single channel, and multiple
workers are launched to poll the channel in current design.

This introduces a problem where UDP packets from a single connection
are delivered to different workers, thus forwarded in a random order
if workers are on different CPU cores. Though UDP peers normally
have their own logic to handle out-of-order packets, this behavior will
inevitably cause significant variance in delay and harm connection quality.
Furthermore, this out-of-order behavior is noticeable even if the underlying
transport could provide guaranteed orderly delivery -  this is unacceptable.

This commit takes the idea of RSS in terms of NICs: it creates a distinct
queue for each worker, hashes incoming packets, and distribute the packet
to a worker by hash result. The tuple (SrcIP, SrcPort, DstIP, DstPort, Proto)
is used for hashing (Proto is always UDP so it's dropped from final
implementation), thus packets from the same connection can be sent to
the same worker, keeping the receiving order. Different connections can be
hashed to different workers to maintain performance.

Performance for single UDP connection is not affected, as there is already
a lock in natTable that prevents multiple packets being processed in different
workers, limiting single connection forwarding performance to 1 worker.
The only performance penalty is the hashing code, which should be neglectable
given the footprint of en/decryption work.

Co-authored-by: Hamster Tian <haotia@gmail.com>
2024-09-25 21:28:30 +08:00
wwqgtxx a08aa10630 chore: some internal types support encoding.TextUnmarshaler 2024-09-19 18:36:24 +08:00
wwqgtxx 8483178524 feat: sniff add skip-src-address and skip-dst-address 2024-08-27 20:33:43 +08:00
wwqgtxx 27bcb26ecd chore: better config internal structure 2024-08-24 20:49:12 +08:00
wwqgtxx 313493cc94 chore: add fswatch 2024-07-24 14:37:10 +08:00
wwqgtxx 09be5cbc99 feat: tun support auto-redirect, route-address-set and route-exclude-address-set 2024-06-17 22:04:51 +08:00
wwqgtxx 40f40f6d24 fix: dns dial to wrong target 2024-06-15 13:32:57 +08:00
wwqgtxx d96d7651ca chore: add inner dns proxied connection log 2024-06-13 09:07:05 +08:00
wwqgtxx f317baa8de feat: add respect-rules for dns 2024-06-12 15:25:34 +08:00
wwqgtxx 40f5c5b987 chore: don't retry when rejected loopback connection 2024-04-03 08:42:15 +08:00
wwqgtxx 367a287153 chore: don't lookup process when Type==INNER 2024-03-28 21:49:44 +08:00
wwqgtxx e6011301b2 chore: rebuild slowdown code 2024-01-30 19:41:50 +08:00
wwqgtxx 2e12ceeaed chore: stop retry when couldn't find ip 2024-01-02 21:49:27 +08:00