128 Commits
Author SHA1 Message Date
fatedier f13fdd58d4 feat: add metricsServer for health checks, metrics and pprof (#5578)
Add a separate HTTP listener for observability, configured through
metricsServer in both frps and frpc. It serves /healthz and, when
pprofEnable is set, the pprof handlers except /debug/pprof/cmdline. It
never serves the dashboard, static assets or the admin API, and it does
not touch the global assets filesystem.

frps also serves /metrics on this listener with both runtime and business
metrics, enabled by metricsServer.port alone. The in-memory collector
still starts only with the dashboard, and the Prometheus collector starts
either with metricsServer or with enablePrometheus plus webServer, so a
configuration that collected nothing before still collects nothing.

The /healthz, /metrics and pprof endpoints on webServer, and
enablePrometheus, keep working but are deprecated and log a hint at
startup. frpc does not serve /metrics yet.
2026-10-19 20:08:39 +08:00
fatedier 399bf2ce4c fix: release listeners when frps fails to start (#5574)
A constructor that binds a port before its fallible preparation leaks the
listener when a later step returns an error, and no one can close it because
the returned service is nil.

pkg/util/http: load the TLS keypair and build the auth middleware before
net.Listen, so binding is the last step that can run and a failure leaves no
bound port behind.

server: create the web server after auth, the tcpmux, main, kcp, quic, ssh
gateway and vhost listeners, and the nat hole controller, following what frpc
already does. If the web server itself fails, close the resources created so
far before returning. The port managers start their cleanup workers on
creation, so they are created after every fallible step too, and the metrics
collectors keep being enabled only when the web server is configured.

Add regression tests for all three failure paths.
2026-10-19 12:20:25 +08:00
fatedier 55107d003d fix: synchronize service startup and shutdown (#5560) 2026-10-09 12:27:12 +08:00
fatedier 758f07d59e deps: migrate to fatedier/yamux v0.2.0 (#5498) 2026-08-18 00:24:11 +08:00
fatedier da04e1e07a log: improve prefix handling (#5489) 2026-08-12 23:56:00 +08:00
fatedier 2291e8835f feat: use binary codec for SUDP packets (#5461) 2026-07-31 16:53:16 +08:00
fatedier effa496859 feat: add negotiated binary UDP packets (#5456) 2026-07-30 13:19:55 +08:00
fatedier f8fc3c6b1b server: drop HTTP/1.1 h2c upgrade handling (#5436)
Use net/http Server.Protocols and the merged golib listener path instead of the deprecated h2c handler. Keep HTTP/1.1 and cleartext HTTP/2 prior-knowledge support, while intentionally dropping HTTP/1.1 Upgrade: h2c.
2026-07-22 19:55:42 +08:00
fatedier d486018885 fix(server): prevent control replacement lifecycle leaks (#5424) 2026-07-21 18:09:09 +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
fatedier 7f8d68b666 feat: use wire v2 framing for UDP workConn payload (#5340) 2026-06-01 16:22:34 +08:00
fatedier 8666e3643f protocol: add AEAD encryption negotiation to v2 wire control channel (#5304) 2026-05-06 10:43:47 +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 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
Oleksandr Redko bd200b1a3b fix: typos in comments, tests, functions (#5216) 2026-03-07 18:43:04 +08:00
fatedier 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
fatedier 01997deb98 add persistent proxy/visitor store with CRUD API and web UI (#5188) 2026-03-02 01:09:59 +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 1245f8804e server: replace client metadata with IP address in registry (#5118) 2026-01-09 11:07:19 +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 1cf325bb0c https: add load balancing group support (#5032) 2025-10-28 17:37:18 +08:00
fatedier 610e5ed479 improve yamux logging (#4952) 2025-08-25 17:52:58 +08:00
fatedierandDevin AI e6dacf3a67 Fix SSH tunnel gateway binding address issue #4900 (#4902)
- Fix SSH tunnel gateway incorrectly binding to proxyBindAddr instead of bindAddr
- This caused external connections to fail when proxyBindAddr was set to 127.0.0.1
- SSH tunnel gateway now correctly binds to bindAddr for external accessibility
- Update Release.md with bug fix description

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2025-07-28 15:19:56 +08:00
fatedierandDevin AI 61330d4d79 Update quic-go dependency from v0.48.2 to v0.53.0 (#4862)
- Update go.mod to use github.com/quic-go/quic-go v0.53.0
- Replace quic.Connection interface with *quic.Conn struct
- Replace quic.Stream interface with *quic.Stream struct
- Update all affected files to use new API:
  - pkg/util/net/conn.go: Update QuicStreamToNetConn function and wrapQuicStream struct
  - server/service.go: Update HandleQUICListener function parameter
  - client/visitor/xtcp.go: Update QUICTunnelSession struct field
  - client/connector.go: Update defaultConnectorImpl struct field

Fixes #4852

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2025-07-01 18:56:46 +08:00
fatedier 3c8d648ddc vnet: fix issues (#4771) 2025-04-27 15:46:22 +08:00
fatedier e0dd947e6a frps: release resources in service.Close() (#4667) 2025-02-12 12:22:57 +08:00
ubergeek77 8b86e1473c Fix ports not being released on Service.Close() (#4666) 2025-02-12 11:28:30 +08:00
fatedier dd7e2e8473 return 504 instead of 404 for proxy type http request timeout (#4151) 2024-04-11 20:19:08 +08:00
fatedier f16ef00975 set CompatibilityMode for android (#4091) 2024-03-21 17:34:09 +08:00
fatedier 8383d528d9 disable quic-go's ECN support by default (#4069) 2024-03-15 14:22:03 +08:00
fatedier 86c2ad78c8 disable quic-go's receive buffer warning (#4063) 2024-03-13 21:53:09 +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 d5b41f1e14 sshTunnelGateway refactor (#3784) 2023-11-22 14:35:37 +08:00
0x7fffandint7 8b432e179d feat: ssh client implement (#3671)
* feat: frps support ssh

* fix: comments

* fix: update pkg

* fix: remove useless change

---------

Co-authored-by: int7 <int7@gmail.com>
2023-11-22 14:35:37 +08:00
Aarni Koskela f5d5a00eef Fix various typos (#3783) 2023-11-22 14:30:22 +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 7cd02f5bd8 add e2e tests for v1 config (#3608) 2023-09-13 16:32:39 +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 3235addaaa update dependencies (#3539) 2023-07-21 14:34:44 +08:00
fatedier 4c4d5f0d0d service.Run supports passing in context (#3504) 2023-06-29 18:04:20 +08:00
fatedier ea08de668e yamux: change default MaxStreamWindowSize to 6MB (#3474) 2023-06-04 19:58:55 +08:00
fatedier de85c9455a stcp, xtcp, sudp: support allow_users and specified server user (#3472) 2023-06-02 16:06:29 +08:00
fatedier 555db9d272 format import package name (#3455) 2023-05-29 14:10:34 +08:00
fatedier c71efde303 refactor the code related to xtcp (#3449) 2023-05-28 16:50:43 +08:00
fatedier a22d6c9504 frpc: support nathole discover (#3381) 2023-03-30 20:28:15 +08:00