Commit Graph
75 Commits
Author SHA1 Message Date
fatedier f32adb3bbb fix(server): close the mux session when a control is replaced or exits (#5596)
When a client logs in again with the same run ID, frps replaces the old
control and closes its control stream, but the yamux session that carried it
stays open until keepalive reclaims it. The replaced control's work
connections and streams share that session, so they are left behind for up to
tcpMuxKeepaliveInterval plus the ping budget.

A mux session carries exactly one control connection, so the control now
records its session and closes it from the single teardown point shared by
replacement, fatal exit and shutdown. QUIC and non-multiplexed transports keep
the previous path.

Closing the session ends every stream that still belongs to the replaced
control. Those proxies are already being torn down, so the cost is that
in-flight connections of the old control are interrupted immediately instead
of at the keepalive deadline. A replacement control is not affected, and the
ownership rules for a still-online control do not change.

Tests: replacement and fatal exit close the session while the replacement
control keeps working, and concurrent logins with the same run ID leave
exactly one live session.
2026-11-03 23:31:44 +08:00
fatedier 2291e8835f feat: use binary codec for SUDP packets (#5461) 2026-07-31 16:53:16 +08:00
fatedier 1ab59e763c server: validate control pool counts (#5459) 2026-07-30 23:30:16 +08:00
fatedier effa496859 feat: add negotiated binary UDP packets (#5456) 2026-07-30 13:19:55 +08:00
fatedier d486018885 fix(server): prevent control replacement lifecycle leaks (#5424) 2026-07-21 18:09:09 +08:00
fatedier 7f8d68b666 feat: use wire v2 framing for UDP workConn payload (#5340) 2026-06-01 16:22:34 +08:00
fatedier e9464919d1 protocol: add v2 wire protocol with binary framing and capability negotiation (#5294) 2026-04-27 00:17:00 +08:00
fatedier 764a626b6e server/control: deduplicate close-proxy logic and UserInfo construction (#5218)
Extract closeProxy() helper to eliminate duplicated 4-step cleanup
sequence (Close, PxyManager.Del, metrics, plugin notify) between
worker() and CloseProxy().

Extract loginUserInfo() helper to eliminate 4 repeated plugin.UserInfo
constructions using LoginMsg fields.

Optimize worker() to snapshot and clear the proxies map under lock,
then perform cleanup outside the lock to reduce lock hold time.
2026-03-08 00:02:14 +08:00
Oleksandr Redko c2454e7114 refactor: fix modernize lint issues (#5215) 2026-03-07 23:10:19 +08:00
fatedier 017d71717f server: introduce SessionContext to encapsulate NewControl parameters (#5217)
Replace 10 positional parameters in NewControl() with a single
SessionContext struct, matching the client-side pattern. This also
eliminates the post-construction mutation of clientRegistry and
removes two TODO comments.
2026-03-07 20:17:00 +08:00
fatedier 266c492b5d web/frps: add detailed client and proxy views with enhanced tracking (#5144) 2026-01-31 02:18:35 +08:00
fatedier ed13141c56 refactor: separate API handlers into dedicated packages with improved HTTP utilities (#5127) 2026-01-14 19:50:55 +08:00
fatedier 36718d88e4 server: add client registry with dashboard support (#5115) 2026-01-08 20:07:14 +08:00
fatedier 7526d7a69a refactor: separate auth config from runtime and defer token resolution (#5105) 2025-12-25 00:53:08 +08:00
fatedier 2e2802ea13 refactor: use MessageSender interface for message transporter (#5083) 2025-12-02 11:22:48 +08:00
fatedier 3c8d648ddc vnet: fix issues (#4771) 2025-04-27 15:46:22 +08:00
fatedier ee3892798d change default value of heartbeat interval and timeout when tcpmux enabled (#4186) 2024-04-28 20:48:44 +08:00
fatedier 43ba7bd338 use new log package (#4054) 2024-03-12 13:58:53 +08:00
fatedier 69ae2b0b69 optimize some code (#3801) 2023-11-27 15:47:49 +08:00
fatedier 184223cb2f Code refactoring related to message handling and retry logic. (#3745) 2023-11-06 10:51:48 +08:00
fatedier 5e70d5bee0 code optimization (#3625) 2023-09-20 15:18:50 +08:00
fatedier c95311d1a0 support yaml/json/toml configuration format, make ini deprecated (#3599) 2023-09-06 10:18:02 +08:00
fatedier 6430afcfa5 fix a goroutine leak issue caused by Login plugin timeout (#3547) 2023-07-25 15:12:40 +08:00
fatedier 46ff40543a update github actions (#3538) 2023-07-21 10:30:46 +08:00
fatedier 15a245766e fix the issue of duplicate xtcp proxies will cause the previous proxy to become ineffective (#3489) 2023-06-16 00:41:06 +08:00
fatedier de85c9455a stcp, xtcp, sudp: support allow_users and specified server user (#3472) 2023-06-02 16:06:29 +08:00
fatedier 9aef3b9944 adjust code style about config (#3464) 2023-05-30 20:25:22 +08:00
fatedier 555db9d272 format import package name (#3455) 2023-05-29 14:10:34 +08:00
fatedier 98068402c8 add release notes (#3453) 2023-05-29 01:09:53 +08:00
fatedier c71efde303 refactor the code related to xtcp (#3449) 2023-05-28 16:50:43 +08:00
fatedier 2f59e967a0 web/frps: more info (#3326) 2023-02-22 00:39:56 +08:00
fatedier 9d077b02cf lint by golangci-lint (#3080) 2022-08-29 01:02:53 +08:00
fatedier 4af85da0c2 type http/tcpmux proxy support route_by_http_user, tcpmux support passthourgh mode (#2932) 2022-05-26 23:57:30 +08:00
cui fliter 915d9f4c09 fix some typos (#2882)
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-04-02 17:35:51 +08:00
Harry Cheng bf635c0e90 Notify server plugins when a proxy is closed (#2823)
* add close proxy op

* Move to actual closing routine

* Fix e2e tests for CloseProxy

* Add warning on resource exhaustion

* Add CloseProxy to manual close

* retuen errors to `CloseProxy` callers
2022-03-08 15:08:09 +08:00
fatedier 293003fcdb allow to disable application layer heartbeat to reduce traffic cost (#2758)
fix #2754
2022-01-13 14:26:07 +08:00
fatedier 02b12df887 frpc: consider include configs for verify and reload command (#2424) 2021-06-02 23:54:22 +08:00
yuyulei 127a31ea6a Fix typo (#2089) 2020-11-23 11:38:21 +08:00
fatedier 3fbdea0f6b rename models to pkg (#2005) 2020-09-23 13:49:14 +08:00
fatedier 8b75b8b837 fix by golint (#1822) 2020-05-24 17:48:37 +08:00
zhang-wei ad0c449a75 Server manager support the NewUserConn operation (#1740)
support NewUserConn operation
2020-04-16 13:06:46 +08:00
Guy Lewin a4b105dedb [Feature] Server Plugin - Ping and NewWorkConn RPC (#1702) 2020-03-18 01:52:44 +08:00
Guy Lewin 10acf638f8 [Feature] Include RunId in FRP Server Plugin NewProxy message (#1700)
* feat: include RunId in FRP Server Plugin NewProxy message

* doc: rewrite server plugin documentation
2020-03-14 23:26:35 +08:00
fatedier 495d999b6c refactoring monitor code, support prometheus (#1668)
* refactoring monitor code, support prometheus
* remove vendor
2020-03-11 13:20:26 +08:00
Guy Lewin 6c6607ae68 feat: add multiple authentication methods, token and oidc.
token is the current token comparison, and oidc generates oidc token using client-credentials flow. in addition - add ping verification using the same method
2020-03-01 10:57:01 +08:00
Guy Lewin 98fa3855bd CR: export error string generation to a function 2020-02-11 16:57:38 +02:00
Guy Lewin f8c6795119 DetailedErrorsToClient - only send detailed error info if this is on 2020-02-10 19:29:57 +02:00
fatedier 91e46a2c53 support server plugin feature 2019-12-23 20:00:04 +08:00
fatedier 649f47c345 change log method 2019-10-12 20:13:12 +08:00
fatedier e9e86fccf0 let max_pool_count valid 2019-08-29 21:13:21 +08:00