-
-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4324 from fatedier/dev
bump version
- Loading branch information
Showing
17 changed files
with
283 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
### Fixes | ||
### Features | ||
|
||
* Fixed an issue where HTTP/2 was not enabled for https2http and https2https plugins. | ||
* Fixed the issue where the default values of INI configuration parameters are inconsistent with other configuration formats. | ||
* Added a new plugin "http2http" which allows forwarding HTTP requests to another HTTP server, supporting options like local address binding, host header rewrite, and custom request headers. | ||
* Added `enableHTTP2` option to control whether to enable HTTP/2 in plugin https2http and https2https, default is true. | ||
|
||
### Changes | ||
|
||
* Updated the default value of `transport.tcpMuxKeepaliveInterval` from 60 to 30. | ||
* On the Android platform, the Google DNS server is used only when the default DNS server cannot be obtained. | ||
* Plugin https2http & https2https: return 421 `Misdirected Request` if host not match sni. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// Copyright 2024 The frp Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package plugin | ||
|
||
import ( | ||
"io" | ||
stdlog "log" | ||
"net" | ||
"net/http" | ||
"net/http/httputil" | ||
|
||
"github.com/fatedier/golib/pool" | ||
|
||
v1 "github.com/fatedier/frp/pkg/config/v1" | ||
"github.com/fatedier/frp/pkg/util/log" | ||
netpkg "github.com/fatedier/frp/pkg/util/net" | ||
) | ||
|
||
func init() { | ||
Register(v1.PluginHTTP2HTTP, NewHTTP2HTTPPlugin) | ||
} | ||
|
||
type HTTP2HTTPPlugin struct { | ||
opts *v1.HTTP2HTTPPluginOptions | ||
|
||
l *Listener | ||
s *http.Server | ||
} | ||
|
||
func NewHTTP2HTTPPlugin(options v1.ClientPluginOptions) (Plugin, error) { | ||
opts := options.(*v1.HTTP2HTTPPluginOptions) | ||
|
||
listener := NewProxyListener() | ||
|
||
p := &HTTP2HTTPPlugin{ | ||
opts: opts, | ||
l: listener, | ||
} | ||
|
||
rp := &httputil.ReverseProxy{ | ||
Rewrite: func(r *httputil.ProxyRequest) { | ||
req := r.Out | ||
req.URL.Scheme = "http" | ||
req.URL.Host = p.opts.LocalAddr | ||
if p.opts.HostHeaderRewrite != "" { | ||
req.Host = p.opts.HostHeaderRewrite | ||
} | ||
for k, v := range p.opts.RequestHeaders.Set { | ||
req.Header.Set(k, v) | ||
} | ||
}, | ||
BufferPool: pool.NewBuffer(32 * 1024), | ||
ErrorLog: stdlog.New(log.NewWriteLogger(log.WarnLevel, 2), "", 0), | ||
} | ||
|
||
p.s = &http.Server{ | ||
Handler: rp, | ||
ReadHeaderTimeout: 0, | ||
} | ||
|
||
go func() { | ||
_ = p.s.Serve(listener) | ||
}() | ||
|
||
return p, nil | ||
} | ||
|
||
func (p *HTTP2HTTPPlugin) Handle(conn io.ReadWriteCloser, realConn net.Conn, _ *ExtraInfo) { | ||
wrapConn := netpkg.WrapReadWriteCloserToConn(conn, realConn) | ||
_ = p.l.PutConn(wrapConn) | ||
} | ||
|
||
func (p *HTTP2HTTPPlugin) Name() string { | ||
return v1.PluginHTTP2HTTP | ||
} | ||
|
||
func (p *HTTP2HTTPPlugin) Close() error { | ||
return p.s.Close() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
|
||
package version | ||
|
||
var version = "0.58.1" | ||
var version = "0.59.0" | ||
|
||
func Full() string { | ||
return version | ||
|
Oops, something went wrong.