Commit graph

39 commits

Author SHA1 Message Date
Toby
2412f23646
Merge commit from fork
The UDP relay treated the destination address as packet-scoped while
applying ACL/outbound policy only once when a new session was created.
After an authenticated client opened a UDP session using a permitted
first destination, later packets carrying a different Addr in the same
SessionID were written via the established outbound socket without
re-checking policy, allowing the client to reach destinations that ACL
should reject — including localhost and RFC1918 from the server's
network perspective. See GHSA-vgrc-hq28-p3xp.

Add a no-I/O CheckUDP method to the Outbound / PluggableOutbound
chain. The UDP session entry now consults CheckUDP for every packet
whose destination differs from the session's first one, dropping
rejected packets before WriteTo. Decisions are cached per destination
within the session (bounded at 256 entries with simple eviction) so
steady-state cost is one map lookup per packet and no extra sockets
or dials. CheckUDP propagates through the existing chain:

  - aclEngine routes through the matched outbound's CheckUDP, with
    aclRejectOutbound returning the rejection error.
  - directOutbound / socks5Outbound / speedtestHandler return nil.
  - httpOutbound returns errHTTPUDPNotSupported.
  - Resolvers (system / dot / doh) run resolve() then forward to
    Next.CheckUDP so IP-based ACL rules keep matching.

Regression tests in core/internal/integration_tests/udp_acl_test.go
use an in-package stub Outbound to assert that a rejected destination
is not relayed after the session is opened on a permitted one, and
that multi-destination sessions over permitted addresses still work.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 14:09:41 -07:00
Toby
93f68c526b
feat: Hysteria Realms (#1560)
* feat(wip): hysteria realms

* feat: port prediction for punching symmetric NAT

* feat: add "cert" subcommand for easy self signed cert generation

* refactor: update address scheme from "hysteria2+realm" to just "realm"

* fix: give up on realm register fatal errors

* chore: update formatting (gofumpt)

* perf: realm proxy UDP methods on PunchPacketConn so quic-go and obfs keep DF/PMTU and buffer sizing

* feat: add support for local UDP source port config in realm addresses

* doc: README for realm pkg
2026-05-08 14:16:21 -07:00
Toby
697203f49d feat: omit datagram TP 2026-04-25 17:07:05 -07:00
Toby
6476d21c59
feat: client & server use quic.Transport (#1550) 2026-04-21 14:02:37 -07:00
Toby
5fd6d4d887 feat: server side UDP port range listening (nftables/iptables) 2026-03-29 11:47:09 -07:00
Toby
b3f2193f10 feat: add configurable congestion modes and BBR profiles 2026-03-28 13:11:17 -07:00
Hari
6da70e80aa
fix: consume TCP request frame type with StreamDispatcher 2026-02-18 10:18:52 +08:00
Hari
275bcccaa4
feat: quic-go v0.59.0 2026-02-17 17:37:20 +08:00
tobyxdd
44235d3de9 feat: quic-go v0.54.0 2025-09-13 16:17:59 -07:00
shadow
6cb18ff5ad Add optional mTLS support for client & server 2025-08-27 12:17:24 +08:00
Toby
b5ddcb5bc4 feat: quic-go v0.52.0 2025-06-07 11:59:30 -07:00
Toby
3e8c20518d chore: minor code tweaks 2024-11-08 14:29:50 -08:00
Haruue
0681638568
feat(trafficlogger): dump streams stats 2024-11-08 15:28:50 +09:00
Toby
c78dbb38a1 feat: add a Check method to let the implementation decide whether to hook a request 2024-06-18 21:46:25 -07:00
Toby
2c62a1a1b4 fix: do not require client-side fast open 2024-06-16 13:26:02 -07:00
Toby
feacb1f85e feat(core): server RequestHook support 2024-06-15 14:15:56 -07:00
Haruue
0c198abd2e
fix: mod name major version suffix v2
ref: https://go.dev/ref/mod#major-version-suffixes
2024-05-18 11:28:47 +08:00
Toby
9d4b3e608a chore: small changes to TrafficLogger function names & update all mocks to mockery v2.43.0 2024-05-11 13:55:55 -07:00
Haruue
6a34a9e7a0
test: fix unit tests
mock files regenerated with mockery v2.43.0
2024-05-11 15:08:44 +08:00
Haruue
ba9b3cdebb
refactor(online): track count instead of raddr 2024-05-11 11:23:20 +08:00
HynoR
88eef7617f refactor getOnline feature 2024-05-09 14:05:45 +08:00
Toby
b79c43171a fix: update in quic-go (http3) broke UDP functionality 2024-04-28 20:22:11 -07:00
Toby
00813c4622 feat: quic-go v0.43.0 2024-04-27 13:04:51 -07:00
Toby
c62dc51017 feat: quic-go v0.40.0 2023-11-12 15:42:46 -08:00
Toby
cc0d0181e1 feat: ignoreClientBandwidth 2023-08-07 16:34:35 -07:00
Toby
3b4af8035b chore: some code fixes 2023-08-04 17:48:07 -07:00
Toby
45c3fc54bd feat: BBR 2023-08-04 17:29:15 -07:00
Toby
c64b36b8f4 feat: update to quic-go v0.37.1, module renamed to github.com/apernet/quic-go 2023-07-31 17:27:23 -07:00
Toby
dd836b4496 feat(wip): test reworks 2023-07-26 13:48:08 -07:00
Toby
f142a24047 chore: more naming adjustments 2023-07-23 12:27:27 -07:00
Toby
1f499f07c7 chore: naming adjustments 2023-07-23 12:10:10 -07:00
Toby
a2fbcc6507 feat(wip): udp rework server side 2023-07-23 11:42:52 -07:00
tobyxdd
7e177a22f7 feat: port forwarding 2023-07-02 15:40:16 -07:00
tobyxdd
cc8a889503 feat: quic close error code 2023-06-27 22:39:16 -07:00
tobyxdd
4334d8afb8 feat: traffic logger with disconnect 2023-06-08 20:55:08 -07:00
tobyxdd
5b54edd09a feat: traffic logger (wip, disconnect not done) 2023-06-07 22:37:09 -07:00
tobyxdd
5586303825 feat: bump quic-go version to v0.35.1 (mod wip), change client config format for sni 2023-06-02 16:51:17 -07:00
tobyxdd
ebb9b3217e feat: add padding to requests & responses 2023-05-31 21:53:15 -07:00
tobyxdd
9f54aade8f hysteria 2 prototype first public release 2023-05-25 20:24:24 -07:00