[GH-ISSUE #1239] [range:] cannot handle too many ports? #978

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

Originally created by @Tennyleaz on GitHub (May 9, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1239

Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.
(为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。)

Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST

What version of frp are you using (./frpc -v or ./frps -v)?
0.27.0 on both sides.

What operating system and processor architecture are you using (go env)?
Ubuntu 16.04 amd64 server, Windows 10 amd64 client.

Configures you used:
frps.ini:

[common]
bind_addr = 0.0.0.0
bind_port = 7000

bind_udp_port = 7001

kcp_bind_port = 7000

dashboard_port = 7700
dashboard_user = user
dashboard_pwd = password

max_ports_per_client = 0

frpc.ini:

[common]
server_addr = server ip
server_port = 7000

[range:tcp_port]
type = tcp
local_ip = 127.0.0.1
local_port = 49000-65000
remote_port = 49000-65000

Steps to reproduce the issue:

  1. Start frp server using ./frps -c ./frps.ini
  2. Start frp client using ./frpc -c ./frpc.ini

Describe the results you received:
Server error log like:

....
[I] [tcp.go:66] [bd3d12cefb2a287f] [tcp_port_4464] tcp proxy listen port [53464]
[I] [control.go:398] [bd3d12cefb2a287f] new proxy [tcp_port_4464] success
[I] [tcp.go:66] [bd3d12cefb2a287f] [tcp_port_4569] tcp proxy listen port [53569]
[I] [control.go:398] [bd3d12cefb2a287f] new proxy [tcp_port_4569] success
[W] [control.go:395] [bd3d12cefb2a287f] new proxy [tcp_port_3460] error: port unavailable
[W] [control.go:395] [bd3d12cefb2a287f] new proxy [tcp_port_9424] error: port unavailable
[W] [control.go:395] [bd3d12cefb2a287f] new proxy [tcp_port_402] error: port unavailable
...
[E] [control.go:288] [bd3d12cefb2a287f] panic error: send on closed channel

Client error log like:

...
[I] [control.go:144] [tcp_port_4464] start proxy success
[I] [control.go:144] [tcp_port_4569] start proxy success
[W] [control.go:142] [tcp_port_3460] start error: port unavailable
[W] [control.go:142] [tcp_port_9424] start error: port unavailable
....

Describe the results you expected:
I expect all ports 49000~65000 should be routed to client.

Additional information you deem important (e.g. issue happens only occasionally):
Always happen.

Can you point out what caused this issue (optional)

Originally created by @Tennyleaz on GitHub (May 9, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1239 Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly. (为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。) Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST **What version of frp are you using (./frpc -v or ./frps -v)?** 0.27.0 on both sides. **What operating system and processor architecture are you using (`go env`)?** Ubuntu 16.04 amd64 server, Windows 10 amd64 client. **Configures you used:** frps.ini: [common] bind_addr = 0.0.0.0 bind_port = 7000 bind_udp_port = 7001 kcp_bind_port = 7000 dashboard_port = 7700 dashboard_user = user dashboard_pwd = password max_ports_per_client = 0 frpc.ini: [common] server_addr = server ip server_port = 7000 [range:tcp_port] type = tcp local_ip = 127.0.0.1 local_port = 49000-65000 remote_port = 49000-65000 **Steps to reproduce the issue:** 1. Start frp server using `./frps -c ./frps.ini` 2. Start frp client using `./frpc -c ./frpc.ini` **Describe the results you received:** Server error log like: .... [I] [tcp.go:66] [bd3d12cefb2a287f] [tcp_port_4464] tcp proxy listen port [53464] [I] [control.go:398] [bd3d12cefb2a287f] new proxy [tcp_port_4464] success [I] [tcp.go:66] [bd3d12cefb2a287f] [tcp_port_4569] tcp proxy listen port [53569] [I] [control.go:398] [bd3d12cefb2a287f] new proxy [tcp_port_4569] success [W] [control.go:395] [bd3d12cefb2a287f] new proxy [tcp_port_3460] error: port unavailable [W] [control.go:395] [bd3d12cefb2a287f] new proxy [tcp_port_9424] error: port unavailable [W] [control.go:395] [bd3d12cefb2a287f] new proxy [tcp_port_402] error: port unavailable ... [E] [control.go:288] [bd3d12cefb2a287f] panic error: send on closed channel Client error log like: ... [I] [control.go:144] [tcp_port_4464] start proxy success [I] [control.go:144] [tcp_port_4569] start proxy success [W] [control.go:142] [tcp_port_3460] start error: port unavailable [W] [control.go:142] [tcp_port_9424] start error: port unavailable .... **Describe the results you expected:** I expect all ports 49000~65000 should be routed to client. **Additional information you deem important (e.g. issue happens only occasionally):** Always happen. **Can you point out what caused this issue (optional)**
Author
Owner

@ooiuv commented on GitHub (May 9, 2019):

You can test whether the following configuration can be executed successfully.

frpc.ini:
[common]
server_addr = server ip
server_port = 7000

[range:tcp_port]
type = tcp
local_ip = 127.0.0.1
local_port = 49000-49003
remote_port = 49000-49003

If the above configuration is executed successfully, FRP limits the number of ports mapped. You need to add the following configuration in frps.ini to increase the number of ports mapped.

frps.ini
max_pool_count = 10

<!-- gh-comment-id:490737823 --> @ooiuv commented on GitHub (May 9, 2019): You can test whether the following configuration can be executed successfully. frpc.ini: [common] server_addr = server ip server_port = 7000 [range:tcp_port] type = tcp local_ip = 127.0.0.1 local_port = 49000-49003 remote_port = 49000-49003 If the above configuration is executed successfully, FRP limits the number of ports mapped. You need to add the following configuration in frps.ini to increase the number of ports mapped. frps.ini max_pool_count = 10
Author
Owner

@Tennyleaz commented on GitHub (May 9, 2019):

I tested ports 49000-49010, found no errors.

If I set max_pool_count = 10, and I tested ports 49000-60000, leading to the similar error logs.
Should I increase max_pool_count further?

<!-- gh-comment-id:490753791 --> @Tennyleaz commented on GitHub (May 9, 2019): I tested ports 49000-49010, found no errors. If I set `max_pool_count = 10`, and I tested ports 49000-60000, leading to the similar error logs. Should I increase `max_pool_count` further?
Author
Owner

@ooiuv commented on GitHub (May 9, 2019):

Max_pool_count is greater than the number of ports you want to map. Example: max_pool_count = 11002
@Tennyleaz

<!-- gh-comment-id:490758524 --> @ooiuv commented on GitHub (May 9, 2019): Max_pool_count is greater than the number of ports you want to map. Example: max_pool_count = 11002 @Tennyleaz
Author
Owner

@fatedier commented on GitHub (Jun 4, 2019):

It's not optimized for too many ports. (Need high bandwidth and cpu and memory)

And I don't want to do that in the future. Why not VPN instead ?

<!-- gh-comment-id:498539474 --> @fatedier commented on GitHub (Jun 4, 2019): It's not optimized for too many ports. (Need high bandwidth and cpu and memory) And I don't want to do that in the future. Why not VPN instead ?
Author
Owner

@Tennyleaz commented on GitHub (Jun 11, 2019):

I want those ports open in order to stream games from my Xbox One remotely. My router seems can't handle a VPN client, so I would like to try frp instead.

<!-- gh-comment-id:500695944 --> @Tennyleaz commented on GitHub (Jun 11, 2019): I want those ports open in order to stream games from my Xbox One remotely. My router seems can't handle a VPN client, so I would like to try frp instead.
Author
Owner

@ooiuv commented on GitHub (Dec 27, 2019):

I want those ports open in order to stream games from my Xbox One remotely. My router seems can't handle a VPN client, so I would like to try frp instead.

Sorry, I just saw the message, if you want to map too many ports, I suggest only VPN mode, I understand FRP is a bit like 1 to 1 mode

<!-- gh-comment-id:569190928 --> @ooiuv commented on GitHub (Dec 27, 2019): > I want those ports open in order to stream games from my Xbox One remotely. My router seems can't handle a VPN client, so I would like to try frp instead. Sorry, I just saw the message, if you want to map too many ports, I suggest only VPN mode, I understand FRP is a bit like 1 to 1 mode
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#978
No description provided.