44 Commits
Author SHA1 Message Date
Mxmilu666andGitHub 71b31978b3 fix(server): close underlying work conn when server bandwidth limiter is enabled (#5553)
When bandwidthLimitMode is "server", the work connection is wrapped by
libio.WrapReadWriteCloser with a close callback that captured the
variable being reassigned (local/rwc). At call time the callback
referenced the wrapper itself, whose closed guard was already set, so
Close returned nil without closing the underlying work connection.

For TCP proxies this left libio.Join blocked on the other copy
goroutine after the user disconnected, keeping the work connection and
the backend connection open. HTTP and UDP proxies had the same pattern.

Bind the Close method value before reassignment, and add an e2e test
verifying that the local connection is closed after the user
disconnects.
2026-10-10 10:45:34 +08:00
fatedierandGitHub d20a232996 test: strengthen health check coverage (#5528) 2026-09-10 01:28:26 +08:00
fatedierandGitHub 2291e8835f feat: use binary codec for SUDP packets (#5461) 2026-07-31 16:53:16 +08:00
fatedierandGitHub effa496859 feat: add negotiated binary UDP packets (#5456) 2026-07-30 13:19:55 +08:00
fatedierandGitHub d486018885 fix(server): prevent control replacement lifecycle leaks (#5424) 2026-07-21 18:09:09 +08:00
fatedierandGitHub 14628df63c test: cover tls2raw proxy protocol header (#5376) 2026-06-23 00:04:38 +08:00
fatedier 0773938d70 feat: bridge mixed wire protocol SUDP payloads (#5347)
SUDP payload codec follows transport wireProtocol; same-protocol v1/v1 and v2/v2 keep raw join; only mixed proxy/visitor protocols use message-aware bridge; no new capability/selection field.
2026-06-01 16:22:34 +08:00
fatedierandGitHub e9464919d1 protocol: add v2 wire protocol with binary framing and capability negotiation (#5294) 2026-04-27 00:17:00 +08:00
fatedierandGitHub a9a4416ecf vhost/http: fix auth bypass when routeByHTTPUser is used with proxy-style requests (#5285) 2026-04-14 00:58:19 +08:00
fatedierandGitHub 31e271939b test/e2e: allocate dynamic ports outside whitelist ranges in server whitelist test (#5268) 2026-03-30 00:21:30 +08:00
fatedierandGitHub ff4ad2f907 auth/oidc: fix eager token fetch at startup, add validation and e2e tests (#5234) 2026-03-15 22:29:45 +08:00
fatedierandGitHub 4f584f81d0 test/e2e: replace sleeps with event-driven waits in chaos/group/store tests (#5231)
* test/e2e: replace sleeps with event-driven waits in chaos/group/store tests

Replace 21 time.Sleep calls with deterministic waiting using
WaitForOutput, WaitForTCPReady, and a new WaitForTCPUnreachable helper.
Add CountOutput method for snapshot-based incremental log matching.

* test/e2e: validate interval and cap dial/sleep to remaining deadline in WaitForTCPUnreachable
2026-03-12 00:11:09 +08:00
fatedierandGitHub bcd2424c24 test/e2e: optimize e2e test time by replacing sleeps with TCP readiness checks (#5223)
Replace the fixed 500ms sleep after each frps startup in RunProcesses
with a TCP dial-based readiness check that polls the server bind port.
This reduces the e2e suite wall time from ~97s to ~43s.

Also simplify the RunProcesses API to accept a single server template
string instead of a slice, matching how every call site uses it.
2026-03-08 23:41:33 +08:00
fatedierandGitHub c7ac12ea0f server/group: refactor with shared abstractions and fix concurrency issues (#5222)
* server/group: refactor group package with shared abstractions and fix concurrency issues

Extract common patterns into reusable components:
- groupRegistry[G]: generic concurrent map for group lifecycle management
- baseGroup: shared plumbing for listener-based groups (TCP, HTTPS, TCPMux)
- Listener: unified virtual listener replacing 3 identical implementations

Fix concurrency issues:
- Stale-pointer race: isCurrent check + errGroupStale + controller retry loops
- Worker generation safety: pass realLn and acceptCh as params instead of reading mutable fields
- Connection leak: close conn on worker panic recovery path
- ABBA deadlock in HTTP UnRegister: consistent lock ordering (group.mu -> registry.mu)
- Round-robin overflow in HTTPGroup: use unsigned modulo

Add unit tests (17 tests) for registry, listener, and baseGroup.
Add TCPMux group load balancing e2e test.

* server/group: replace tautological assertion with require.NotPanics

* server/group: remove blank line between doc comment and type declaration
2026-03-08 18:57:21 +08:00
Oleksandr RedkoandGitHub c2454e7114 refactor: fix modernize lint issues (#5215) 2026-03-07 23:10:19 +08:00
Oleksandr RedkoandGitHub bd200b1a3b fix: typos in comments, tests, functions (#5216) 2026-03-07 18:43:04 +08:00
fatedierandGitHub fbeb6ca43a refactor: restructure API packages into client/http and server/http with typed proxy/visitor models (#5193) 2026-03-04 17:38:43 +08:00
fatedierandGitHub 01997deb98 add persistent proxy/visitor store with CRUD API and web UI (#5188) 2026-03-02 01:09:59 +08:00
fatedierandGitHub 33428ab538 add e2e tests for exec-based token source (#5111) 2026-01-04 14:45:51 +08:00
fatedierandGitHub 1cf325bb0c https: add load balancing group support (#5032) 2025-10-28 17:37:18 +08:00
fatedierandGitHub f9065a6a78 add tokenSource support for auth configuration (#4865) 2025-07-03 13:17:21 +08:00
fatedier 43cf1688e4 update golangci-lint version (#4817) 2025-06-25 11:40:23 +08:00
fatedier 3fa76b72f3 add proxy protocol support for UDP proxies (#4810) 2025-06-25 11:40:23 +08:00
fatedier 3c8d648ddc vnet: fix issues (#4771) 2025-04-27 15:46:22 +08:00
fatedierandGitHub ae73ec2fed added a 30s timeout for frpc subcommands to avoid long delays (#4359) 2024-07-30 18:12:22 +08:00
fatedierandGitHub 69cc422edf client plugin: added plugin tls2raw (#4341) 2024-07-25 14:28:17 +08:00
fatedierandGitHub 939c490768 Add http2http client plugin with hostHeaderRewrite and requestHeaders support (#4275) 2024-06-12 17:30:10 +08:00
fatedierandGitHub e81b36c5ba support responseHeaders.set for proxy type http (#4192) 2024-04-29 15:53:45 +08:00
fatedierandGitHub dd7e2e8473 return 504 instead of 404 for proxy type http request timeout (#4151) 2024-04-11 20:19:08 +08:00
fatedierandGitHub 590ccda677 fix x-forwarded-for header (#4111) 2024-03-28 16:47:27 +08:00
fatedierandGitHub 3585f5c0c0 support range ports mapping by go template (#4073) 2024-03-15 17:23:16 +08:00
fatedierandGitHub e6ec5a509b update release notes (#4055) 2024-03-12 15:14:13 +08:00
fatedierandGitHub 43ba7bd338 use new log package (#4054) 2024-03-12 13:58:53 +08:00
fatedierandGitHub 3529158f31 proxy supports configuring annotations, which will be displayed in the frps dashboard (#4000) 2024-02-19 16:28:27 +08:00
fatedierandGitHub d01f4a3ec1 cmd: use hyphen instead of underscore (#3898) 2023-12-27 10:44:13 +08:00
fatedierandGitHub 256b87321d improve e2e port allocator (#3882) 2023-12-21 22:46:08 +08:00
fatedierandGitHub 7c799ee921 add e2e tests for ssh tunnel (#3805) 2023-11-28 13:48:32 +08:00
fatedierandGitHub 69ae2b0b69 optimize some code (#3801) 2023-11-27 15:47:49 +08:00
Aarni KoskelaandGitHub f5d5a00eef Fix various typos (#3783) 2023-11-22 14:30:22 +08:00
fatedierandGitHub 526e809bd5 update for strict config (#3779) 2023-11-16 21:03:36 +08:00
fatedierandGitHub 7cc67e852e fix that transport.tls.disableCustomTLSFirstByte doesn't take effect (#3660) 2023-10-11 11:49:40 +08:00
fatedierandGitHub bae0b4d7c0 optimize the code of the command line (#3614) 2023-09-15 10:33:32 +08:00
fatedierandGitHub 74255f711e config: add some validations (#3610) 2023-09-13 18:59:51 +08:00
fatedierandGitHub 7cd02f5bd8 add e2e tests for v1 config (#3608) 2023-09-13 16:32:39 +08:00