Commit Graph
100 Commits
Author SHA1 Message Date
fatedierandGitHub e9f7a1a9f2 pkg: use modern Go stdlib functions to simplify code (#5209)
- strings.CutPrefix instead of HasPrefix+TrimPrefix (naming, legacy)
- slices.Contains instead of manual loop (plugin/server)
- min/max builtins instead of manual comparisons (nathole)
2026-03-06 22:14:46 +08:00
fatedierandGitHub d644593342 server/proxy: simplify HTTPS and TCPMux proxy domain registration (#5208)
Consolidate the separate custom-domain loop and subdomain block into a
single unified loop, matching the pattern already applied to HTTPProxy
in PR #5207. No behavioral change.
2026-03-06 21:31:29 +08:00
fatedierandGitHub 427c4ca3ae server/proxy: simplify HTTP proxy domain registration by removing duplicate loop (#5207)
The Run() method had two nearly identical loop blocks for registering
custom domains and subdomain, with the same group/non-group registration
logic copy-pasted (~30 lines of duplication).

Consolidate by collecting all domains into a single slice first, then
iterating once with the shared registration logic. Also fixes a minor
inconsistency where the custom domain block used routeConfig.Domain in
CanonicalAddr but the subdomain block used tmpRouteConfig.Domain.
2026-03-06 21:17:30 +08:00
fatedierandGitHub f2d1f3739a pkg/util/xlog: fix AddPrefix not updating existing prefix due to range value copy (#5206)
In AddPrefix, the loop `for _, p := range l.prefixes` creates a copy
of each element. Assignments to p.Value and p.Priority only modify
the local copy, not the original slice element, causing updates to
existing prefixes to be silently lost.

This affects client/service.go where AddPrefix is called with
Name:"runID" on reconnection — the old runID value would persist
in log output instead of being updated to the new one.

Fix by using index-based access `l.prefixes[i]` to modify the
original slice element, and add break since prefix names are unique.
2026-03-06 20:44:40 +08:00
fatedierandGitHub c23894f156 fix: validate CA cert parsing and add missing ReadHeaderTimeout (#5205)
- pkg/transport/tls.go: check AppendCertsFromPEM return value and
  return clear error when CA file contains no valid PEM certificates
- pkg/plugin/client/http2http.go: set ReadHeaderTimeout to 60s to
  match other plugins and prevent slow header attacks
- pkg/plugin/client/http2https.go: same ReadHeaderTimeout fix
2026-03-06 17:59:41 +08:00
fatedierandGitHub cb459b02b6 fix: WebsocketListener nil panic and OIDC auth data race (#5204)
- pkg/util/net/websocket.go: store ln parameter in struct to prevent
  nil pointer panic when Addr() is called
- pkg/auth/oidc.go: replace unsynchronized []string with map + RWMutex
  for subjectsFromLogin to fix data race across concurrent connections
2026-03-06 16:51:52 +08:00
fatedierandGitHub 8f633fe363 fix: return buffers to pool on error paths to reduce GC pressure (#5203)
- pkg/nathole/nathole.go: add pool.PutBuf(buf) on ReadFromUDP error
  and DecodeMessageInto error paths in waitDetectMessage
- pkg/proto/udp/udp.go: add defer pool.PutBuf(buf) in writerFn to
  ensure buffer is returned when the goroutine exits
2026-03-06 15:55:22 +08:00
fatedierandGitHub c62a1da161 fix: close connections on error paths to prevent resource leaks (#5202)
Fix connection leaks in multiple error paths across client and server:
- server/proxy/http: close tmpConn when WithEncryption fails
- client/proxy: close localConn when ProxyProtocol WriteTo fails
- client/visitor/sudp: close visitorConn on all error paths in getNewVisitorConn
- client/visitor/xtcp: close tunnelConn when WithEncryption fails
- client/visitor/xtcp: close lConn when NewKCPConnFromUDP fails
- pkg/plugin/client/unix_domain_socket: close localConn and connInfo.Conn when WriteTo fails, close connInfo.Conn when DialUnix fails
- pkg/plugin/client/tls2raw: close tlsConn when Handshake or Dial fails
2026-03-06 15:18:38 +08:00
fatedierandGitHub f22f7d539c server/group: fix port leak and incorrect Listen port in TCPGroup (#5200)
Fix two bugs in TCPGroup.Listen():
- Release acquired port when net.Listen fails to prevent port leak
- Use realPort instead of port for net.Listen to ensure consistency
  between port manager records and actual listening port
2026-03-06 02:25:47 +08:00
fatedierandGitHub 462c987f6d pkg/msg: change UDPPacket.Content from string to []byte to avoid redundant base64 encode/decode (#5198) 2026-03-06 01:38:24 +08:00
fatedierandGitHub 541878af4d docs: update release notes for config parsing error improvements (#5196) 2026-03-05 00:00:46 +08:00
fatedierandGitHub b7435967b0 pkg/config: fix line numbers shown incorrectly for TOML type mismatch errors (#5195) 2026-03-04 20:53:22 +08:00
774478d071 pkg/config: improve error messages with line number details for config parsing (#5194)
When frpc verify encounters config errors, the error messages now include
line/column information to help users locate problems:

- TOML syntax errors: report line and column from the TOML parser
  (e.g., "toml: line 4, column 11: expected character ]")
- Type mismatch errors: report the field name and approximate line number
  (e.g., "line 3: field \"proxies\": cannot unmarshal string into ...")
- File format detection: use file extension to determine format, preventing
  silent fallthrough from TOML to YAML parser which produced confusing errors

Previously, a TOML file with syntax errors would silently fall through to the
YAML parser, which would misinterpret the content and produce unhelpful errors
like "json: cannot unmarshal string into Go value of type v1.ClientConfig".

https://claude.ai/code/session_017HWLfcXS3U2hLoy4dsg8Nv

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-04 19:27:30 +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 381245a439 build: add noweb tag to allow building without frontend assets (#5189) 2026-03-02 01:32:19 +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 d0347325fc pkg/config: fix custom domain validation to prevent false matches with subdomain host (#5178) 2026-02-13 14:10:18 +08:00
fatedierandGitHub 519368b1fd server/api: fix DeleteProxies endpoint returning empty response instead of JSON (#5163) 2026-02-06 11:22:34 +08:00
fatedierandGitHub 9634fd99d1 web: ensure npm install runs before build (#5154) 2026-02-04 12:55:24 +08:00
fatedierandGitHub 7a1c248b67 bump version to 0.67.0 (#5146) 2026-01-31 13:49:29 +08:00
fatedierandGitHub 886c9c2fdb web/frpc: redesign dashboard (#5145) 2026-01-31 12:43:31 +08:00
fatedierandGitHub 266c492b5d web/frps: add detailed client and proxy views with enhanced tracking (#5144) 2026-01-31 02:18:35 +08:00
fatedierandGitHub 5dd70ace6b refactor: move web embeds to web/ directory (#5139) 2026-01-27 02:56:57 +08:00
fatedier fb2c98e87b rotate gold sponsor 2026-01-27 02:45:57 +08:00
fatedierandGitHub ed13141c56 refactor: separate API handlers into dedicated packages with improved HTTP utilities (#5127) 2026-01-14 19:50:55 +08:00
fatedierandGitHub 3370bd53f5 udp: fix proxy protocol header sent on every packet instead of first packet only (#5119) 2026-01-09 11:33:00 +08:00
fatedierandGitHub 1245f8804e server: replace client metadata with IP address in registry (#5118) 2026-01-09 11:07:19 +08:00
fatedierandGitHub 479e9f50c2 web/frpc: refactor dashboard with improved structure and API layer (#5117) 2026-01-09 00:40:51 +08:00
fatedierandGitHub a4175a2595 update release notes (#5116) 2026-01-08 20:25:03 +08:00
fatedierandGitHub 36718d88e4 server: add client registry with dashboard support (#5115) 2026-01-08 20:07:14 +08:00
fatedierandGitHub bc378bcbec rotate gold sponsor order periodically (#5114) 2026-01-08 19:54:13 +08:00
fatedierandGitHub 33428ab538 add e2e tests for exec-based token source (#5111) 2026-01-04 14:45:51 +08:00
fatedierandGitHub ef96481f58 update version and release notes (#5106) 2025-12-25 10:15:40 +08:00
fatedierandGitHub 7526d7a69a refactor: separate auth config from runtime and defer token resolution (#5105) 2025-12-25 00:53:08 +08:00
fatedierandGitHub 2bdf25bae6 rotate gold sponsor order periodically (#5094) 2025-12-11 12:48:08 +08:00
fatedierandGitHub 0fe8f7a0b6 refactor: reorganize security policy into dedicated packag (#5088) 2025-12-05 16:26:09 +08:00
fatedierandGitHub 2e2802ea13 refactor: use MessageSender interface for message transporter (#5083) 2025-12-02 11:22:48 +08:00
fatedierandGitHub c3821202b1 docs: remove zsxq section (#5077) 2025-11-26 23:55:54 +08:00
fatedierandGitHub 15fd19a16d fix lint (#5068) 2025-11-18 01:11:44 +08:00
fatedierandGitHub f736d171ac rotate gold sponsor order periodically (#5067) 2025-11-18 00:09:37 +08:00
fatedierandGitHub b27b846971 config: add enabled field for individual proxy and visitor (#5048) 2025-11-06 14:05:03 +08:00
fatedierandGitHub e025843d3c vnet: add exponential backoff for failed reconnections (#5035) 2025-10-29 01:08:48 +08:00
fatedierandGitHub a75320ef2f update quic-go dependency from v0.53.0 to v0.55.0 (#5033) 2025-10-28 17:52:34 +08:00
fatedierandGitHub 1cf325bb0c https: add load balancing group support (#5032) 2025-10-28 17:37:18 +08:00
fatedierandGitHub 469097a549 update sponsor pic (#5031) 2025-10-28 16:08:29 +08:00
fatedierandGitHub 2def23bb0b update sponsor (#5030) 2025-10-28 15:44:03 +08:00
fatedierandGitHub e382676659 update README (#5001) 2025-09-26 12:26:08 +08:00
fatedierandGitHub b5e90c03a1 bump version to v0.65.0 and update release notes (#4998) 2025-09-25 20:11:17 +08:00
fatedierandGitHub b642a6323c update sponsors info (#4997) 2025-09-25 16:50:14 +08:00
fatedierandGitHub abf4942e8a auth: enhance OIDC client with TLS and proxy configuration options (#4990) 2025-09-25 10:19:19 +08:00
fatedierandGitHub 0a798a7a69 update go version to 1.24 (#4960) 2025-08-27 15:10:36 +08:00
fatedierandGitHub 604700cea5 update README (#4957) 2025-08-27 11:07:18 +08:00
fatedierandGitHub 610e5ed479 improve yamux logging (#4952) 2025-08-25 17:52:58 +08:00
fatedierandGitHub 80d3f332e1 xtcp: add configuration to disable assisted addresses in NAT traversal (#4951) 2025-08-25 15:52:52 +08:00
fatedierandGitHub 024c334d9d Merge pull request #4928 from fatedier/xtcp
improve context and polling logic in xtcp visitor
2025-08-12 01:48:26 +08:00
fatedierandGitHub f795950742 bump version to v0.64.0 (#4924) 2025-08-10 23:11:50 +08:00
fatedierandGitHub 024e4f5f1d improve random TLS certificate generation (#4923) 2025-08-10 22:59:28 +08:00
fatedierandGitHub dc3bc9182c update sponsor info (#4917) 2025-08-08 22:28:17 +08:00
fatedierGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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
fatedierandGitHub 7fe295f4f4 update golangci-lint version (#4897) 2025-07-25 17:10:32 +08:00
fatedierandGitHub f9065a6a78 add tokenSource support for auth configuration (#4865) 2025-07-03 13:17:21 +08:00
fatedierGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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 c777891f75 update .golangci.yml (#4848) 2025-06-25 11:40:23 +08:00
fatedier 43cf1688e4 update golangci-lint version (#4817) 2025-06-25 11:40:23 +08:00
fatedier 720c09c06b update test package (#4814) 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 8eb525a648 feat: support YAML merge in strict configuration mode (#4809) 2025-06-25 11:40:23 +08:00
fatedier b41d8f8e40 update release notes (#4772) 2025-04-27 15:46:22 +08:00
fatedier 3c8d648ddc vnet: fix issues (#4771) 2025-04-27 15:46:22 +08:00
fatedier 27f66baf54 update feature gates doc (#4755) 2025-04-27 15:46:22 +08:00
fatedierandGitHub c5a8f6ef4a Merge pull request #4753 from fatedier/dev
bump version
2025-04-16 16:21:11 +08:00
fatedierandGitHub e208043323 vnet: update tun_unsupported function (#4752) 2025-04-16 16:17:26 +08:00
fatedierandGitHub a78814a2e9 virtual-net: initial (#4751) 2025-04-16 16:05:54 +08:00
fatedierandGitHub 31b44c1feb Merge pull request #4700 from fatedier/dev
bump version
2025-03-07 17:26:55 +08:00
fatedierandGitHub 773169e0c4 update version (#4699) 2025-03-07 17:22:51 +08:00
fatedierandGitHub 9757a351c6 fix golangci lint config (#4698) 2025-03-07 16:56:08 +08:00
fatedierandGitHub 1e8db66743 update Release.md (#4668) 2025-02-12 12:30:37 +08:00
fatedierandGitHub e0dd947e6a frps: release resources in service.Close() (#4667) 2025-02-12 12:22:57 +08:00
fatedierandGitHub 27db6217ec frpc: support metadatas and annotations in frpc proxy commands (#4623) 2025-01-06 14:22:57 +08:00
fatedierandGitHub 01fed8d1a9 Update stale workflow (#4600) 2024-12-19 18:13:25 +08:00
fatedierandGitHub 2a7aa69890 Merge pull request #4590 from fatedier/dev
bump version
2024-12-16 19:41:22 +08:00
fatedierandGitHub f47d8ab97f update Release.md (#4589) 2024-12-16 19:33:58 +08:00
fatedierandGitHub 8593eff752 update sponsor info (#4545) 2024-11-20 15:14:51 +08:00
fatedierandGitHub dff56cb0ca update .golangci.yml (#4527) 2024-11-07 17:14:40 +08:00
fatedierandGitHub 4383756fd4 frps: add support for quic-bind-port parameter in frps (#4519) 2024-10-30 15:12:31 +08:00
fatedierandGitHub 6ba849fc75 readme: update sponsor (#4504) 2024-10-22 10:48:24 +08:00
fatedierandGitHub 9d5638cae6 update Release.md (#4500) 2024-10-18 12:31:55 +08:00
fatedierandGitHub 62352c7ba5 dockerfiles: add tzdata (#4499) 2024-10-18 12:03:17 +08:00
fatedierandGitHub 4bbec09d57 Merge pull request #4496 from fatedier/dev
bump version
2024-10-17 17:28:10 +08:00
fatedierandGitHub f7a06cbe61 use go1.23 (#4495) 2024-10-17 17:22:41 +08:00
fatedierandGitHub 3a08c2aeb0 conf: fix example for tls2raw (#4494) 2024-10-17 16:27:41 +08:00
fatedierandGitHub 2855ac71e3 frpc visitor: add --server-user option to specify server proxy username (#4477) 2024-10-09 14:04:30 +08:00
fatedierandGitHub ccfe8c97f4 Merge pull request #4392 from fatedier/dev
bump version
2024-08-19 13:47:36 +08:00
fatedierandGitHub 2dcdb24cc4 replace github.com/templexxx/xorsimd to the new version (#4373) 2024-08-07 11:18:17 +08:00
fatedierandGitHub f1fb2d721a update .github/FUNDING.yml (#4365) 2024-08-02 17:04:59 +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 243ca994e0 Merge pull request #4324 from fatedier/dev
bump version
2024-07-09 10:55:15 +08:00
fatedierandGitHub b4d5d8c756 plugin https2http&https2https: return 421 if host not match sni (#4323) 2024-07-09 10:50:16 +08:00
fatedierandGitHub c6f9d8d403 update sponsors (#4303) 2024-06-26 14:51:34 +08:00