Commit graph

171 commits

Author SHA1 Message Date
Niko Marmeladkov
1e77bbe7b7
feat: TLS 1.3 mimicry obfuscation, multi-mode (auto + plain), session recreation
Some checks are pending
Build master branch / build (push) Waiting to run
Tests / Test (push) Waiting to run
- tlsmimic: wrap QUIC packets in TLS 1.3 record headers
- multi: auto-detect Salamander/TLS-mimic/plain on the same port
- multi: random padding and jitter support for DPI evasion
- reconnect: periodic session recreation via MaxSessionDuration
- client/server: wire tlsmimic/auto/plain obfs types and config
- NEW_FEATURES: translated to English
2026-06-17 16:36:29 +03:00
Niko Marmeladkov
da8366eb8a
feat: L3 VPN tunnel, FileMask noise, Hysteria outbound
- Network: Layer 3 IP tunnel over QUIC with TUN interfaces and IP pool
- FileMask: new noise/obfuscation layer masking traffic as encrypted file downloads
- Hysteria outbound: chain Hysteria servers via pluggable outbound
2026-06-16 16:07:55 +03:00
Toby
42ebbc5576
feat(realm): add ipMode option to restrict connections to v4 or v6 (#1602)
Adds a new realm "ipMode" config option (v4 | v6 | dual, default dual)
on both client and server that restricts realm connections to a single
IP family end-to-end: the UDP socket is bound to udp4/udp6, STUN only
gathers addresses of that family, and hole punching only tries peer
candidates of that family.
2026-06-13 12:07:05 -07:00
Toby
33bb55a208
feat(realm): UPnP/NAT-PMP port mapping support (#1600) 2026-06-10 18:16:27 -07:00
白日梦主义
247c91321f
fix(outbounds): bound standard resolver CNAME chains (#1595)
The standardResolver's lookup4/lookup6 methods recursively follow CNAME
chains without any depth limit or cycle detection. A malicious or
misconfigured DNS server returning a self-referential CNAME record
(e.g. loop.example. CNAME loop.example.) causes infinite recursion,
leading to stack overflow and crash.

Add a max depth limit of 16 and a visited-set to detect cycles. The
original lookup4/lookup6 entry points are preserved; they delegate to
lookup4WithCNAMEDepth/lookup6WithCNAMEDepth which track depth and seen
hosts across recursive calls.
2026-06-04 18:16:18 -07:00
白日梦主义
829d125ea2
fix(outbounds): use hostname for HTTPS proxy SNI (#1597)
The httpOutbound.dial() method incorrectly sets tls.Config.ServerName
to o.Addr, which is the "host:port" address string. TLS SNI must be a
pure hostname without a port number. Sending "host:port" as SNI causes
invalid TLS ClientHello messages and may prevent the proxy server from
correctly routing the connection.

Use o.ServerName instead, which is already correctly set to u.Hostname()
in NewHTTPOutbound.
2026-06-04 15:08:18 -07:00
Toby
c3a806b5cb
feat: gecko obfs (experimental) (#1584) 2026-05-22 20:35:41 -07:00
Toby
3b64f66995
fix(outbounds): incorrect use of SOCKS5 UDP dst.addr & dst.port (#1583) 2026-05-21 16:08:15 -07:00
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
02d7b0a54d fix: format 2026-05-21 13:41:49 -07:00
白日梦主义
89521dd80a
Merge commit from fork
Cap HTTP sniff reads to a fixed budget so incomplete or
oversized requests can't cause unbounded memory growth
while preserving normal sniff behavior.

Signed-off-by: Cherrling <me@cherr.cc>
2026-05-21 13:09:11 -07:00
白日梦主义
3991117d27
fix(acl): normalize trailing dot in domain matches (#1574)
* fix(acl): normalize trailing dot in domain matches

The ACL like

```yaml
    - reject(example.com)
    - reject(suffix:blocked.test)
    - reject(*.wild.test)
```

can be easily bypass through by adding a dot to the domain like

example.com.:443

Signed-off-by: Cherrling <me@cherr.cc>

* fix(acl): trim all trailing dots and add tests

Use strings.TrimRight instead of strings.TrimSuffix so domains with
multiple trailing dots (e.g. example.com..) are also normalized and
cannot bypass ACL rules. Add test coverage for trailing-dot handling
on exact, wildcard and suffix domain rules, as well as for trailing
dots in rule patterns.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Signed-off-by: Cherrling <me@cherr.cc>
Co-authored-by: Toby <tobyxdd@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 14:06:04 -07:00
白日梦主义
6dc0f3f792
fix: prefix match in DNS https (#1573)
Signed-off-by: Cherrling <me@cherr.cc>
2026-05-15 16:37:19 -07:00
白日梦主义
d34dc40eff
fix(outbounds): reject invalid port values (#1569) 2026-05-15 16:24:47 -07:00
Toby
64c3963856 fix(realm): client should accept punch packets from any source address 2026-05-10 10:13:49 -07:00
Toby
c1868d5c14 feat(realm): STUN on connect 2026-05-08 19:13:20 -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
99ad91c58a fix: avoid mutating PSK backing storage in salamander obfs 2026-04-26 13:57:19 -07:00
Toby
697203f49d feat: omit datagram TP 2026-04-25 17:07:05 -07:00
白日梦主义
1b6636afe6
fix: repair the oom problem when enable sniff (#1547) 2026-04-18 11:33:00 -07:00
Toby
d08b493ff9 fix: quic-go congestion datagram size panic issue 2026-03-29 22:16:13 -07:00
Toby
6ef838d2c8 feat: port hopping random interval 2026-03-29 14:00:12 -07:00
Toby
5fd6d4d887 feat: server side UDP port range listening (nftables/iptables) 2026-03-29 11:47:09 -07:00
Toby
61c75a260f fix: BBR scale window for datagram size 2026-03-27 18:13:57 -07:00
tobyxdd
5252803b35 feat: time-based speed test 2026-02-21 17:42:43 -08:00
tobyxdd
18960685d3 Merge remote-tracking branch 'origin/master' into refactor/app-client 2026-02-21 17:14:47 -08:00
tobyxdd
dd913426c5 chore: code tweaks 2026-02-21 17:07:28 -08:00
tobyxdd
ea2e858c06 chore: bump cobra & viper versions 2026-02-21 17:03:34 -08:00
tobyxdd
aa2768627c fix: apernet/quic-go go mod tag ref 2026-02-17 12:16:26 -08:00
Hari
275bcccaa4
feat: quic-go v0.59.0 2026-02-17 17:37:20 +08:00
tobyxdd
f68d036bff feat: migrate to new monotime congestion interface 2026-01-11 11:06:12 -08:00
tobyxdd
9efcdef6e9 feat: quic-go v0.57.1 2026-01-10 12:32:34 -08:00
tobyxdd
6e59b176a6 fix: memory leak in quic-go 2025-10-23 19:49:21 -07:00
tobyxdd
7d727cfeaa chore: update Go version to 1.25 in workflows and go.mod files 2025-09-13 16:22:21 -07:00
tobyxdd
44235d3de9 feat: quic-go v0.54.0 2025-09-13 16:17:59 -07:00
tobyxdd
36370ffbbb fix: race in udpSessionManager cleanup & update code formatting (gofumpt) 2025-09-11 20:14:41 -07:00
Toby
b2485e6405
Merge pull request #1433 from apernet/fix-acl-cache
fix(acl): error rule applied due to bad cache key
2025-09-10 21:36:23 -07:00
Haruue
c6488c21c1
fix: remove license-conflicted doh library 2025-09-10 16:29:48 +09:00
Haruue
5ef85697f3
fix(acl): error rule applied due to bad cache key
close: #1432
2025-09-10 15:00:32 +09:00
Toby
b5ddcb5bc4 feat: quic-go v0.52.0 2025-06-07 11:59:30 -07:00
Toby
b2567df63c
Merge pull request #1347 from apernet/bump-quic
feat: quic-go v0.51.0
2025-04-20 14:29:31 -07:00
Toby
c2c4a9545e fix: broken cc after connection migration 2025-04-20 14:27:45 -07:00
Toby
29cd04fdef feat: quic-go v0.51.0 (wip) 2025-04-20 14:04:53 -07:00
dropbigfish
5239a23aee chore: fix function name in comment
Signed-off-by: dropbigfish <fillfish@foxmail.com>
2025-04-20 12:06:13 +08:00
Toby
ffab01730a chore: add LICENSE to packages 2025-03-18 20:44:59 -07:00
Toby
401ed5245d
Merge pull request #1306 from apernet/wip-userpass-ignore-case
Make username of userpass case insensitive
2025-02-03 18:05:27 -08:00
Toby
e11ad2b93b feat: quic-go v0.49.0 2025-02-03 18:04:17 -08:00
Haruue
7652ddcd99
chore: unexport UserPassAuthenticator.Users 2025-02-03 12:39:52 +09:00
Haruue
e1df8aa4e2
chore: make username of userpass case insensitive
close: #1297

Just a workaround for "uppercase usernames do not work".

Usernames in different cases (like "Gawr" and "gawR") will now conflict.
2025-02-03 12:34:01 +09:00
Haruue
d8c61c59d7
chore: disable fallback mode of tfo dialer
tfo-go caches the "unsupported" status when fallback mode is enabled.
In other words, if the hysteria server is started with
net.ipv4.tcp_fastopen=0 and it fails once, the tfo will not be enabled
until it is restarted, even if the user later sets sysctl
net.ipv4.tcp_fastopen=3.
2024-11-23 22:31:14 +09:00