Skip to content

Commit a1348cd

Browse files
authored
bump version (#5112)
2 parents 2f5e1f7 + 33428ab commit a1348cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1153
-367
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ linters:
3939
- G404
4040
- G501
4141
- G115
42+
- G204
4243
severity: low
4344
confidence: low
4445
govet:

README.md

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,14 @@ frp is an open source project with its ongoing development made possible entirel
1313

1414
<h3 align="center">Gold Sponsors</h3>
1515
<!--gold sponsors start-->
16-
<p align="center">
17-
<a href="https://www.recall.ai/?utm_source=github&utm_medium=sponsorship&utm_campaign=fatedier-frp" target="_blank">
18-
<b>Recall.ai - API for meeting recordings</b><br>
19-
<br>
20-
<sup>If you're looking for a meeting recording API, consider checking out Recall.ai, an API that records Zoom, Google Meet, Microsoft Teams, in-person meetings, and more.</sup>
21-
</a>
22-
</p>
23-
<p align="center">
24-
<a href="https://go.warp.dev/frp" target="_blank">
25-
<img width="360px" src="https://raw.githubusercontent.com/warpdotdev/brand-assets/refs/heads/main/Github/Sponsor/Warp-Github-LG-01.png">
26-
<br>
27-
<b>Warp, built for collaborating with AI Agents</b>
28-
<br>
29-
<sub>Available for macOS, Linux and Windows</sub>
30-
</a>
31-
</p>
3216
<p align="center">
3317
<a href="https://jb.gg/frp" target="_blank">
3418
<img width="420px" src="https://raw.githubusercontent.com/fatedier/frp/dev/doc/pic/sponsor_jetbrains.jpg">
3519
<br>
3620
<b>The complete IDE crafted for professional Go developers</b>
3721
</a>
3822
</p>
39-
<p align="center">
40-
<a href="https://github.com/daytonaio/daytona" target="_blank">
41-
<img width="420px" src="https://raw.githubusercontent.com/fatedier/frp/dev/doc/pic/sponsor_daytona.png">
42-
<br>
43-
<b>Secure and Elastic Infrastructure for Running Your AI-Generated Code</b>
44-
</a>
45-
</p>
23+
4624
<p align="center">
4725
<a href="https://github.com/beclab/Olares" target="_blank">
4826
<img width="420px" src="https://raw.githubusercontent.com/fatedier/frp/dev/doc/pic/sponsor_olares.jpeg">
@@ -52,6 +30,34 @@ frp is an open source project with its ongoing development made possible entirel
5230
<sub>An open source, self-hosted alternative to public clouds, built for data ownership and privacy</sub>
5331
</a>
5432
</p>
33+
34+
<div align="center">
35+
36+
## Recall.ai - API for meeting recordings
37+
38+
If you're looking for a meeting recording API, consider checking out [Recall.ai](https://www.recall.ai/?utm_source=github&utm_medium=sponsorship&utm_campaign=fatedier-frp),
39+
40+
an API that records Zoom, Google Meet, Microsoft Teams, in-person meetings, and more.
41+
42+
</div>
43+
<p align="center">
44+
<a href="https://requestly.com/?utm_source=github&utm_medium=partnered&utm_campaign=frp" target="_blank">
45+
<img width="480px" src="https://github.com/user-attachments/assets/24670320-997d-4d62-9bca-955c59fe883d">
46+
<br>
47+
<b>Requestly - Free & Open-Source alternative to Postman</b>
48+
<br>
49+
<sub>All-in-one platform to Test, Mock and Intercept APIs.</sub>
50+
</a>
51+
</p>
52+
<p align="center">
53+
<a href="https://go.warp.dev/frp" target="_blank">
54+
<img width="360px" src="https://raw.githubusercontent.com/warpdotdev/brand-assets/refs/heads/main/Github/Sponsor/Warp-Github-LG-01.png">
55+
<br>
56+
<b>Warp, built for collaborating with AI Agents</b>
57+
<br>
58+
<sub>Available for macOS, Linux and Windows</sub>
59+
</a>
60+
</p>
5561
<!--gold sponsors end-->
5662

5763
## What is frp?

README_zh.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,14 @@ frp 是一个完全开源的项目,我们的开发工作完全依靠赞助者
1515

1616
<h3 align="center">Gold Sponsors</h3>
1717
<!--gold sponsors start-->
18-
<p align="center">
19-
<a href="https://www.recall.ai/?utm_source=github&utm_medium=sponsorship&utm_campaign=fatedier-frp" target="_blank">
20-
<b>Recall.ai - API for meeting recordings</b><br>
21-
<br>
22-
<sup>If you're looking for a meeting recording API, consider checking out Recall.ai, an API that records Zoom, Google Meet, Microsoft Teams, in-person meetings, and more.</sup>
23-
</a>
24-
</p>
25-
<p align="center">
26-
<a href="https://go.warp.dev/frp" target="_blank">
27-
<img width="360px" src="https://raw.githubusercontent.com/warpdotdev/brand-assets/refs/heads/main/Github/Sponsor/Warp-Github-LG-01.png">
28-
<br>
29-
<b>Warp, built for collaborating with AI Agents</b>
30-
<br>
31-
<sub>Available for macOS, Linux and Windows</sub>
32-
</a>
33-
</p>
3418
<p align="center">
3519
<a href="https://jb.gg/frp" target="_blank">
3620
<img width="420px" src="https://raw.githubusercontent.com/fatedier/frp/dev/doc/pic/sponsor_jetbrains.jpg">
3721
<br>
3822
<b>The complete IDE crafted for professional Go developers</b>
3923
</a>
4024
</p>
41-
<p align="center">
42-
<a href="https://github.com/daytonaio/daytona" target="_blank">
43-
<img width="420px" src="https://raw.githubusercontent.com/fatedier/frp/dev/doc/pic/sponsor_daytona.png">
44-
<br>
45-
<b>Secure and Elastic Infrastructure for Running Your AI-Generated Code</b>
46-
</a>
47-
</p>
25+
4826
<p align="center">
4927
<a href="https://github.com/beclab/Olares" target="_blank">
5028
<img width="420px" src="https://raw.githubusercontent.com/fatedier/frp/dev/doc/pic/sponsor_olares.jpeg">
@@ -54,6 +32,33 @@ frp 是一个完全开源的项目,我们的开发工作完全依靠赞助者
5432
<sub>An open source, self-hosted alternative to public clouds, built for data ownership and privacy</sub>
5533
</a>
5634
</p>
35+
<div align="center">
36+
37+
## Recall.ai - API for meeting recordings
38+
39+
If you're looking for a meeting recording API, consider checking out [Recall.ai](https://www.recall.ai/?utm_source=github&utm_medium=sponsorship&utm_campaign=fatedier-frp),
40+
41+
an API that records Zoom, Google Meet, Microsoft Teams, in-person meetings, and more.
42+
43+
</div>
44+
<p align="center">
45+
<a href="https://requestly.com/?utm_source=github&utm_medium=partnered&utm_campaign=frp" target="_blank">
46+
<img width="480px" src="https://github.com/user-attachments/assets/24670320-997d-4d62-9bca-955c59fe883d">
47+
<br>
48+
<b>Requestly - Free & Open-Source alternative to Postman</b>
49+
<br>
50+
<sub>All-in-one platform to Test, Mock and Intercept APIs.</sub>
51+
</a>
52+
</p>
53+
<p align="center">
54+
<a href="https://go.warp.dev/frp" target="_blank">
55+
<img width="360px" src="https://raw.githubusercontent.com/warpdotdev/brand-assets/refs/heads/main/Github/Sponsor/Warp-Github-LG-01.png">
56+
<br>
57+
<b>Warp, built for collaborating with AI Agents</b>
58+
<br>
59+
<sub>Available for macOS, Linux and Windows</sub>
60+
</a>
61+
</p>
5762
<!--gold sponsors end-->
5863

5964
## 为什么使用 frp ?
@@ -126,9 +131,3 @@ frp 是一个免费且开源的项目,我们欢迎任何人为其开发和进
126131
国内用户可以通过 [爱发电](https://afdian.com/a/fatedier) 赞助我们。
127132

128133
企业赞助者可以将贵公司的 Logo 以及链接放置在项目 README 文件中。
129-
130-
### 知识星球
131-
132-
如果您想了解更多 frp 相关技术以及更新详解,或者寻求任何 frp 使用方面的帮助,都可以通过微信扫描下方的二维码付费加入知识星球的官方社群:
133-
134-
![zsxq](/doc/pic/zsxq.jpg)

Release.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
## Features
22

3-
* Add NAT traversal configuration options for XTCP proxies and visitors. Support disabling assisted addresses to avoid using slow VPN connections during NAT hole punching.
4-
* Enhanced OIDC client configuration with support for custom TLS certificate verification and proxy settings. Added `trustedCaFile`, `insecureSkipVerify`, and `proxyURL` options for OIDC token endpoint connections.
5-
* Added detailed Prometheus metrics with `proxy_counts_detailed` metric that includes both proxy type and proxy name labels, enabling monitoring of individual proxy connections instead of just aggregate counts.
3+
* HTTPS proxies now support load balancing groups. Multiple HTTPS proxies can be configured with the same `loadBalancer.group` and `loadBalancer.groupKey` to share the same custom domain and distribute traffic across multiple backend services, similar to the existing TCP and HTTP load balancing capabilities.
4+
* Individual frpc proxies and visitors now accept an `enabled` flag (defaults to true), letting you disable specific entries without relying on the global `start` list—disabled blocks are skipped when client configs load.
5+
* OIDC authentication now supports a `tokenSource` field to dynamically obtain tokens from external sources. You can use `type = "file"` to read a token from a file, or `type = "exec"` to run an external command (e.g., a cloud CLI or secrets manager) and capture its stdout as the token. The `exec` type requires the `--allow-unsafe=TokenSourceExec` CLI flag for security reasons.
6+
7+
## Improvements
8+
9+
* **VirtualNet**: Implemented intelligent reconnection with exponential backoff. When connection errors occur repeatedly, the reconnect interval increases from 60s to 300s (max), reducing unnecessary reconnection attempts. Normal disconnections still reconnect quickly at 10s intervals.
10+
11+
## Fixes
12+
13+
* Fix deadlock issue when TCP connection is closed. Previously, sending messages could block forever if the connection handler had already stopped.

client/admin_api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (svr *Service) apiReload(w http.ResponseWriter, r *http.Request) {
9292
log.Warnf("reload frpc proxy config error: %s", res.Msg)
9393
return
9494
}
95-
if _, err := validation.ValidateAllClientConfig(cliCfg, proxyCfgs, visitorCfgs); err != nil {
95+
if _, err := validation.ValidateAllClientConfig(cliCfg, proxyCfgs, visitorCfgs, svr.unsafeFeatures); err != nil {
9696
res.Code = 400
9797
res.Msg = err.Error()
9898
log.Warnf("reload frpc proxy config error: %s", res.Msg)

client/control.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ type SessionContext struct {
4343
Conn net.Conn
4444
// Indicates whether the connection is encrypted.
4545
ConnEncrypted bool
46-
// Sets authentication based on selected method
47-
AuthSetter auth.Setter
46+
// Auth runtime used for login, heartbeats, and encryption.
47+
Auth *auth.ClientAuth
4848
// Connector is used to create new connections, which could be real TCP connections or virtual streams.
4949
Connector Connector
5050
// Virtual net controller
@@ -91,7 +91,7 @@ func NewControl(ctx context.Context, sessionCtx *SessionContext) (*Control, erro
9191
ctl.lastPong.Store(time.Now())
9292

9393
if sessionCtx.ConnEncrypted {
94-
cryptoRW, err := netpkg.NewCryptoReadWriter(sessionCtx.Conn, []byte(sessionCtx.Common.Auth.Token))
94+
cryptoRW, err := netpkg.NewCryptoReadWriter(sessionCtx.Conn, sessionCtx.Auth.EncryptionKey())
9595
if err != nil {
9696
return nil, err
9797
}
@@ -100,9 +100,9 @@ func NewControl(ctx context.Context, sessionCtx *SessionContext) (*Control, erro
100100
ctl.msgDispatcher = msg.NewDispatcher(sessionCtx.Conn)
101101
}
102102
ctl.registerMsgHandlers()
103-
ctl.msgTransporter = transport.NewMessageTransporter(ctl.msgDispatcher.SendChannel())
103+
ctl.msgTransporter = transport.NewMessageTransporter(ctl.msgDispatcher)
104104

105-
ctl.pm = proxy.NewManager(ctl.ctx, sessionCtx.Common, ctl.msgTransporter, sessionCtx.VnetController)
105+
ctl.pm = proxy.NewManager(ctl.ctx, sessionCtx.Common, sessionCtx.Auth.EncryptionKey(), ctl.msgTransporter, sessionCtx.VnetController)
106106
ctl.vm = visitor.NewManager(ctl.ctx, sessionCtx.RunID, sessionCtx.Common,
107107
ctl.connectServer, ctl.msgTransporter, sessionCtx.VnetController)
108108
return ctl, nil
@@ -133,7 +133,7 @@ func (ctl *Control) handleReqWorkConn(_ msg.Message) {
133133
m := &msg.NewWorkConn{
134134
RunID: ctl.sessionCtx.RunID,
135135
}
136-
if err = ctl.sessionCtx.AuthSetter.SetNewWorkConn(m); err != nil {
136+
if err = ctl.sessionCtx.Auth.Setter.SetNewWorkConn(m); err != nil {
137137
xl.Warnf("error during NewWorkConn authentication: %v", err)
138138
workConn.Close()
139139
return
@@ -243,7 +243,7 @@ func (ctl *Control) heartbeatWorker() {
243243
sendHeartBeat := func() (bool, error) {
244244
xl.Debugf("send heartbeat to server")
245245
pingMsg := &msg.Ping{}
246-
if err := ctl.sessionCtx.AuthSetter.SetPing(pingMsg); err != nil {
246+
if err := ctl.sessionCtx.Auth.Setter.SetPing(pingMsg); err != nil {
247247
xl.Warnf("error during ping authentication: %v, skip sending ping message", err)
248248
return false, err
249249
}

client/proxy/proxy.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ func NewProxy(
5757
ctx context.Context,
5858
pxyConf v1.ProxyConfigurer,
5959
clientCfg *v1.ClientCommonConfig,
60+
encryptionKey []byte,
6061
msgTransporter transport.MessageTransporter,
6162
vnetController *vnet.Controller,
6263
) (pxy Proxy) {
@@ -69,6 +70,7 @@ func NewProxy(
6970
baseProxy := BaseProxy{
7071
baseCfg: pxyConf.GetBaseConfig(),
7172
clientCfg: clientCfg,
73+
encryptionKey: encryptionKey,
7274
limiter: limiter,
7375
msgTransporter: msgTransporter,
7476
vnetController: vnetController,
@@ -86,6 +88,7 @@ func NewProxy(
8688
type BaseProxy struct {
8789
baseCfg *v1.ProxyBaseConfig
8890
clientCfg *v1.ClientCommonConfig
91+
encryptionKey []byte
8992
msgTransporter transport.MessageTransporter
9093
vnetController *vnet.Controller
9194
limiter *rate.Limiter
@@ -129,7 +132,7 @@ func (pxy *BaseProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn) {
129132
return
130133
}
131134
}
132-
pxy.HandleTCPWorkConnection(conn, m, []byte(pxy.clientCfg.Auth.Token))
135+
pxy.HandleTCPWorkConnection(conn, m, pxy.encryptionKey)
133136
}
134137

135138
// Common handler for tcp work connections.

client/proxy/proxy_manager.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@ type Manager struct {
4040
closed bool
4141
mu sync.RWMutex
4242

43-
clientCfg *v1.ClientCommonConfig
43+
encryptionKey []byte
44+
clientCfg *v1.ClientCommonConfig
4445

4546
ctx context.Context
4647
}
4748

4849
func NewManager(
4950
ctx context.Context,
5051
clientCfg *v1.ClientCommonConfig,
52+
encryptionKey []byte,
5153
msgTransporter transport.MessageTransporter,
5254
vnetController *vnet.Controller,
5355
) *Manager {
@@ -56,6 +58,7 @@ func NewManager(
5658
msgTransporter: msgTransporter,
5759
vnetController: vnetController,
5860
closed: false,
61+
encryptionKey: encryptionKey,
5962
clientCfg: clientCfg,
6063
ctx: ctx,
6164
}
@@ -163,7 +166,7 @@ func (pm *Manager) UpdateAll(proxyCfgs []v1.ProxyConfigurer) {
163166
for _, cfg := range proxyCfgs {
164167
name := cfg.GetBaseConfig().Name
165168
if _, ok := pm.proxies[name]; !ok {
166-
pxy := NewWrapper(pm.ctx, cfg, pm.clientCfg, pm.HandleEvent, pm.msgTransporter, pm.vnetController)
169+
pxy := NewWrapper(pm.ctx, cfg, pm.clientCfg, pm.encryptionKey, pm.HandleEvent, pm.msgTransporter, pm.vnetController)
167170
if pm.inWorkConnCallback != nil {
168171
pxy.SetInWorkConnCallback(pm.inWorkConnCallback)
169172
}

client/proxy/proxy_wrapper.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ func NewWrapper(
9292
ctx context.Context,
9393
cfg v1.ProxyConfigurer,
9494
clientCfg *v1.ClientCommonConfig,
95+
encryptionKey []byte,
9596
eventHandler event.Handler,
9697
msgTransporter transport.MessageTransporter,
9798
vnetController *vnet.Controller,
@@ -122,7 +123,7 @@ func NewWrapper(
122123
xl.Tracef("enable health check monitor")
123124
}
124125

125-
pw.pxy = NewProxy(pw.ctx, pw.Cfg, clientCfg, pw.msgTransporter, pw.vnetController)
126+
pw.pxy = NewProxy(pw.ctx, pw.Cfg, clientCfg, encryptionKey, pw.msgTransporter, pw.vnetController)
126127
return pw
127128
}
128129

client/proxy/sudp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (pxy *SUDPProxy) InWorkConn(conn net.Conn, _ *msg.StartWorkConn) {
9191
})
9292
}
9393
if pxy.cfg.Transport.UseEncryption {
94-
rwc, err = libio.WithEncryption(rwc, []byte(pxy.clientCfg.Auth.Token))
94+
rwc, err = libio.WithEncryption(rwc, pxy.encryptionKey)
9595
if err != nil {
9696
conn.Close()
9797
xl.Errorf("create encryption stream error: %v", err)

0 commit comments

Comments
 (0)