forked from fatedier/frp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add doc for port range mapping (fatedier#4081)
- Loading branch information
Showing
3 changed files
with
22 additions
and
3 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
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
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