Compare commits

..

1 Commits

Author SHA1 Message Date
Rezoan Ahmed Abir
a8221859a2
Merge 57d51e3f62eed7c26ac51ab768437e040d7f211d into 9ced717d69495371b557b31e12ed42475d76f72f 2024-05-07 20:53:18 +08:00
3 changed files with 26 additions and 15 deletions

View File

@ -1,3 +1,14 @@
### Notable Changes
We have optimized the heartbeat mechanism when tcpmux is enabled (enabled by default). The default value of `heartbeatInterval` has been adjusted to -1. This update ensures that when tcpmux is active, the client does not send additional heartbeats to the server. Since tcpmux incorporates its own heartbeat system, this change effectively reduces unnecessary data consumption, streamlining communication efficiency between client and server.
When connecting to frps versions older than v0.39.0 might encounter compatibility issues due to changes in the heartbeat mechanism. As a temporary workaround, setting the `heartbeatInterval` to 30 can help maintain stable connectivity with these older versions. We recommend updating to the latest frps version to leverage full functionality and improvements.
### Features
* Show tcpmux proxies on the frps dashboard.
* `http` proxy can modify the response header. For example, `responseHeaders.set.foo = "bar"` will add a new header `foo: bar` to the response.
### Fixes
* Fixed an issue where HTTP/2 was not enabled for https2http and https2https plugins.
* When an HTTP proxy request times out, it returns 504 instead of 404 now.

View File

@ -72,6 +72,11 @@ func NewHTTPS2HTTPPlugin(options v1.ClientPluginOptions) (Plugin, error) {
ErrorLog: stdlog.New(log.NewWriteLogger(log.WarnLevel, 2), "", 0),
}
p.s = &http.Server{
Handler: rp,
ReadHeaderTimeout: 60 * time.Second,
}
var (
tlsConfig *tls.Config
err error
@ -85,15 +90,10 @@ func NewHTTPS2HTTPPlugin(options v1.ClientPluginOptions) (Plugin, error) {
if err != nil {
return nil, fmt.Errorf("gen TLS config error: %v", err)
}
p.s = &http.Server{
Handler: rp,
ReadHeaderTimeout: 60 * time.Second,
TLSConfig: tlsConfig,
}
ln := tls.NewListener(listener, tlsConfig)
go func() {
_ = p.s.ServeTLS(listener, "", "")
_ = p.s.Serve(ln)
}()
return p, nil
}

View File

@ -78,6 +78,11 @@ func NewHTTPS2HTTPSPlugin(options v1.ClientPluginOptions) (Plugin, error) {
ErrorLog: stdlog.New(log.NewWriteLogger(log.WarnLevel, 2), "", 0),
}
p.s = &http.Server{
Handler: rp,
ReadHeaderTimeout: 60 * time.Second,
}
var (
tlsConfig *tls.Config
err error
@ -91,15 +96,10 @@ func NewHTTPS2HTTPSPlugin(options v1.ClientPluginOptions) (Plugin, error) {
if err != nil {
return nil, fmt.Errorf("gen TLS config error: %v", err)
}
p.s = &http.Server{
Handler: rp,
ReadHeaderTimeout: 60 * time.Second,
TLSConfig: tlsConfig,
}
ln := tls.NewListener(listener, tlsConfig)
go func() {
_ = p.s.ServeTLS(listener, "", "")
_ = p.s.Serve(ln)
}()
return p, nil
}