-
-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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 #4092 from fatedier/dev
bump v0.56.0
- Loading branch information
Showing
32 changed files
with
317 additions
and
57 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
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 |
---|---|---|
|
@@ -78,6 +78,7 @@ frp also offers a P2P connect mode. | |
* [URL Routing](#url-routing) | ||
* [TCP Port Multiplexing](#tcp-port-multiplexing) | ||
* [Connecting to frps via PROXY](#connecting-to-frps-via-proxy) | ||
* [Port range mapping](#port-range-mapping) | ||
* [Client Plugins](#client-plugins) | ||
* [Server Manage Plugins](#server-manage-plugins) | ||
* [SSH Tunnel Gateway](#ssh-tunnel-gateway) | ||
|
@@ -1158,6 +1159,24 @@ serverPort = 7000 | |
transport.proxyURL = "http://user:[email protected]:8080" | ||
``` | ||
|
||
### Port range mapping | ||
|
||
*Added in v0.56.0* | ||
|
||
We can use the range syntax of Go template combined with the built-in `parseNumberRangePair` function to achieve port range mapping. | ||
|
||
The following example, when run, will create 8 proxies named `test-6000, test-6001 ... test-6007`, each mapping the remote port to the local port. | ||
|
||
``` | ||
{{- range $_, $v := parseNumberRangePair "6000-6006,6007" "6000-6006,6007" }} | ||
[[proxies]] | ||
name = "tcp-{{ $v.First }}" | ||
type = "tcp" | ||
localPort = {{ $v.First }} | ||
remotePort = {{ $v.Second }} | ||
{{- end }} | ||
``` | ||
|
||
### Client Plugins | ||
|
||
frpc only forwards requests to local TCP or UDP ports by default. | ||
|
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 +1,25 @@ | ||
No feature changes, just a fix for the issue of no released assets in version 0.55.0. | ||
### Features | ||
|
||
* Support range ports mapping in TOML/YAML/JSON configuration file by using go template syntax. | ||
|
||
For example: | ||
|
||
``` | ||
{{- range $_, $v := parseNumberRangePair "6000-6006,6007" "6000-6006,6007" }} | ||
[[proxies]] | ||
name = "tcp-{{ $v.First }}" | ||
type = "tcp" | ||
localPort = {{ $v.First }} | ||
remotePort = {{ $v.Second }} | ||
{{- end }} | ||
``` | ||
|
||
This will create 8 proxies such as `tcp-6000, tcp-6001, ... tcp-6007`. | ||
|
||
* Health check supports custom request headers. | ||
* Enable compatibility mode for the Android system to solve the issues of incorrect log time caused by time zone problems and default DNS resolution failures. | ||
|
||
### Fixes | ||
|
||
* Fix the issue of incorrect interval time for rotating the log by day. | ||
* Disable quic-go's ECN support by default. It may cause issues on certain operating systems. |
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
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
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,52 @@ | ||
// 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 config | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/fatedier/frp/pkg/util/util" | ||
) | ||
|
||
type NumberPair struct { | ||
First int64 | ||
Second int64 | ||
} | ||
|
||
func parseNumberRangePair(firstRangeStr, secondRangeStr string) ([]NumberPair, error) { | ||
firstRangeNumbers, err := util.ParseRangeNumbers(firstRangeStr) | ||
if err != nil { | ||
return nil, err | ||
} | ||
secondRangeNumbers, err := util.ParseRangeNumbers(secondRangeStr) | ||
if err != nil { | ||
return nil, err | ||
} | ||
if len(firstRangeNumbers) != len(secondRangeNumbers) { | ||
return nil, fmt.Errorf("first and second range numbers are not in pairs") | ||
} | ||
pairs := make([]NumberPair, 0, len(firstRangeNumbers)) | ||
for i := 0; i < len(firstRangeNumbers); i++ { | ||
pairs = append(pairs, NumberPair{ | ||
First: firstRangeNumbers[i], | ||
Second: secondRangeNumbers[i], | ||
}) | ||
} | ||
return pairs, nil | ||
} | ||
|
||
func parseNumberRange(firstRangeStr string) ([]int64, error) { | ||
return util.ParseRangeNumbers(firstRangeStr) | ||
} |
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
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,22 @@ | ||
// 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. | ||
|
||
//go:build !android | ||
|
||
package system | ||
|
||
// EnableCompatibilityMode enables compatibility mode for different system. | ||
// For example, on Android, the inability to obtain the correct time zone will result in incorrect log time output. | ||
func EnableCompatibilityMode() { | ||
} |
Oops, something went wrong.