[GH-ISSUE #3781] 是否支持范围端口代理,如40000-50000端口由同一个端口6000反向代理 #3009

Closed
opened 2026-05-05 13:56:37 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @linshangqiang on GitHub (Nov 17, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3781

Describe the feature request

感谢大佬开源

咨询两个问题:
1、是否支持范围端口由同一个端口映射出去,如udp_port : 40000-50000端口映射到6000端口
2、http、udp端口能否使用同一个端口映射

想要达到的目的: 所有需要的端口,不管是http,范围udp端口,都走同一个端口代理,这样服务器只需要开放一个端口。或者http单独走一个端口代理,范围udp端口共同使用一个端口代理,这样服务器对外只需要开发2个端口

我的配置如下:

  • frps.toml
bindPort = 7000
  • frpc.toml
server_addr = 182.245.156.93
server_port = 7000

[udpPortRange]
type = udp
local_ip = 10.10.0.24
local_port = 40000-50000
remote_port = 6000
  • 实际测试结果
    在10.10.0.24上启动了一个监听udp 40001端口的服务
    使用另外一个设备,发送 echo "Hello from UDP client" | nc -u 182.254.156.93 6000
    10.10.0.24未收到任何数据

如果我将local_port = 40000-50000改成local_port = 40000,udp服务器监听40000端口,另一台设备发送 echo "Hello from UDP client" | nc -u 182.254.156.93 6000 时,成功收到数据

想要范围端口能够走同一个端口代理,我该如何配置,如果不能,范围端口-范围代理端口 的这个方案,我该如何配置?

Describe alternatives you've considered

No response

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @linshangqiang on GitHub (Nov 17, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3781 ### Describe the feature request 感谢大佬开源 咨询两个问题: 1、是否支持范围端口由同一个端口映射出去,如udp_port : 40000-50000端口映射到6000端口 2、http、udp端口能否使用同一个端口映射 想要达到的目的: 所有需要的端口,不管是http,范围udp端口,都走同一个端口代理,这样服务器只需要开放一个端口。或者http单独走一个端口代理,范围udp端口共同使用一个端口代理,这样服务器对外只需要开发2个端口 我的配置如下: - frps.toml ``` bindPort = 7000 ``` - frpc.toml ``` server_addr = 182.245.156.93 server_port = 7000 [udpPortRange] type = udp local_ip = 10.10.0.24 local_port = 40000-50000 remote_port = 6000 ``` - 实际测试结果 在10.10.0.24上启动了一个监听udp 40001端口的服务 使用另外一个设备,发送 echo "Hello from UDP client" | nc -u 182.254.156.93 6000 10.10.0.24未收到任何数据 如果我将local_port = 40000-50000改成local_port = 40000,udp服务器监听40000端口,另一台设备发送 echo "Hello from UDP client" | nc -u 182.254.156.93 6000 时,成功收到数据 想要范围端口能够走同一个端口代理,我该如何配置,如果不能,范围端口-范围代理端口 的这个方案,我该如何配置? ### Describe alternatives you've considered _No response_ ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:56:37 -06:00
Author
Owner

@linshangqiang commented on GitHub (Nov 17, 2023):

目前udp范围端口+范围映射已调通,配置如下:

  • frps.toml
bindPort = 7000
  • frpc.toml
[common]
server_addr = 182.254.156.93
server_port = 7000

[range:test_udp]
type = udp
local_ip = 10.10.0.24
local_port = 42000-50000
remote_port = 42000-50000
use_encryption = false
use_compression = false

这种方式需要开放的端口比较多,frp支持 n个udp端口由一个端口代理出去吗

<!-- gh-comment-id:1815805630 --> @linshangqiang commented on GitHub (Nov 17, 2023): 目前udp范围端口+范围映射已调通,配置如下: - frps.toml ``` bindPort = 7000 ``` - frpc.toml ``` [common] server_addr = 182.254.156.93 server_port = 7000 [range:test_udp] type = udp local_ip = 10.10.0.24 local_port = 42000-50000 remote_port = 42000-50000 use_encryption = false use_compression = false ``` 这种方式需要开放的端口比较多,frp支持 n个udp端口由一个端口代理出去吗
Author
Owner

@xqzr commented on GitHub (Nov 17, 2023):

526e809bd5/conf/frpc_full_example.toml (L254-L261) 它可能不支持 UDP

<!-- gh-comment-id:1817003482 --> @xqzr commented on GitHub (Nov 17, 2023): https://github.com/fatedier/frp/blob/526e809bd50eed4ff5c2211adc91126abb864530/conf/frpc_full_example.toml#L254-L261 ~它可能不支持 UDP~
Author
Owner

@linshangqiang commented on GitHub (Nov 19, 2023):

526e809bd5/conf/frpc_full_example.toml (L254-L261)

它可能不支持 UDP
这个配置没看到有指定范围端口。能否告知下完整得配置?

<!-- gh-comment-id:1817902276 --> @linshangqiang commented on GitHub (Nov 19, 2023): > https://github.com/fatedier/frp/blob/526e809bd50eed4ff5c2211adc91126abb864530/conf/frpc_full_example.toml#L254-L261 > > ~它可能不支持 UDP~ 这个配置没看到有指定范围端口。能否告知下完整得配置?
Author
Owner

@xqzr commented on GitHub (Nov 19, 2023):

526e809bd5/conf/frpc_full_example.toml (L254-L261)

它可能不支持 UDP

这个配置没看到有指定范围端口。能否告知下完整得配置?

https://gofrp.org/zh-cn/docs/features/common/client-plugin/

<!-- gh-comment-id:1817935067 --> @xqzr commented on GitHub (Nov 19, 2023): >> https://github.com/fatedier/frp/blob/526e809bd50eed4ff5c2211adc91126abb864530/conf/frpc_full_example.toml#L254-L261 >> >> ~它可能不支持 UDP~ >这个配置没看到有指定范围端口。能否告知下完整得配置? https://gofrp.org/zh-cn/docs/features/common/client-plugin/
Author
Owner

@superzjg commented on GitHub (Nov 21, 2023):

https://github.com/fatedier/frp/issues/3711

<!-- gh-comment-id:1820088766 --> @superzjg commented on GitHub (Nov 21, 2023): https://github.com/fatedier/frp/issues/3711
Author
Owner

@github-actions[bot] commented on GitHub (Dec 22, 2023):

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1867086726 --> @github-actions[bot] commented on GitHub (Dec 22, 2023): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#3009
No description provided.