3x-ui/internal/web/middleware
MHSanaei 3526a65f5d
fix(web): bound the panel's open connections and share asset gzip
The engine-wide gzip middleware gave every in-flight request its own
compressor of about 1 MiB, and the public /assets bundles let an
anonymous client keep a handler blocked in Write until WriteTimeout, so
a thousand stalled downloads held a gigabyte. The listener itself took
any number of connections, each holding buffers and a goroutine before
any login.

The bundles are now served from a gzip copy made once per file, with
the assets prefix left out of the per-request middleware, and the panel
listener closes a new connection once 2048 are open or its source (an
IPv4 address or IPv6 /64) holds 256; a loopback reverse proxy counts
only toward the total.
2026-11-01 01:01:38 +01:00
..
bodylimit.go fix(web): tighten database restore body-cap exemption (#5609) 2026-06-28 15:00:55 +02:00
bodylimit_test.go fix(web): tighten database restore body-cap exemption (#5609) 2026-06-28 15:00:55 +02:00
config_envelope.go fix(api): accept config envelopes only on requests that carry a body 2026-10-31 09:09:06 +00:00
config_envelope_test.go fix(api): accept config envelopes only on requests that carry a body 2026-10-31 09:09:06 +00:00
domainValidator.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
gzip_static.go fix(web): bound the panel's open connections and share asset gzip 2026-11-01 01:01:38 +01:00
gzip_static_test.go fix(web): bound the panel's open connections and share asset gzip 2026-11-01 01:01:38 +01:00
security.go fix(middleware): log rejected CSRF requests with the trusted client address (#6692) 2026-10-24 04:51:21 +02:00
security_test.go fix(middleware): log rejected CSRF requests with the trusted client address (#6692) 2026-10-24 04:51:21 +02:00
validate.go refactor(frontend): move form-item hints from extra to tooltip 2026-06-17 17:24:16 +02:00
validate_mutation_test.go Test-quality audit: fix 2 prod bugs, strengthen weak tests, add mutation/fuzz/CI tooling (#5345) 2026-06-15 15:17:03 +02:00
validate_protocol_test.go fix(inbounds): accept masque in the inbound protocol validator 2026-10-11 10:56:47 +02:00
validate_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00