服务端管理

端口白名单

为了防止端口被滥用,可以手动指定允许哪些端口被使用,在服务端配置中通过 allowPorts 来指定:

# frps.ini
    allowPorts = [
      { start = 2000, end = 3000 },
      { single = 3001 },
      { single = 3003 },
      { start = 4000, end = 50000 }
    ]
    

allowPorts 可以配置允许使用的某个指定端口或者是一个范围内的所有端口。

端口复用

目前 frps 中的 vhostHTTPPortvhostHTTPSPort 支持配置成和 bindPort 为同一个端口,frps 会对连接的协议进行分析,之后进行不同的处理。

例如在某些限制较严格的网络环境中,可以将 bindPortvhostHTTPSPort 都设置为 443。

需要注意的是,如果你想将 vhostHTTPSPortbindPort 配置为相同的端口,需要首先将 transport.tls.disableCustomTLSFirstByte 设置为false。

限速

代理限速

目前支持在客户端的代理配置中设置代理级别的限速,限制单个 proxy 可以占用的带宽。

# frpc.toml
    [[proxies]]
    name = "ssh"
    type = "tcp"
    localPort = 22
    remotePort = 6000
    transport.bandwidthLimit = "1MB"
    

在代理配置中增加 transport.bandwidthLimit 字段启用此功能,目前仅支持 MBKB 单位。

限速能力默认在客户端实现,如果希望启用服务端限速,需要额外配置 transport.bandwidthLimitMode = "server"

最后修改 November 15, 2023: fix 404 (#71) (626ce4d)

Server management

Port Whitelist

To prevent port abuse, you can manually specify which ports are allowed to be used in the Server Through side configuration allowPortsto specify:

# frps.ini
    allowPorts = [
      { start = 2000, end = 3000 },
      { single = 3001 },
      { single = 3003 },
      { start = 4000, end = 50000 }
    ]
    

AllowPorts Configuration allows for the use of a specific port or all ports within a range.

Port Multiplexing

Currently, thevhostHTTPPortand vhostHTTPSPortSupports Configuration and bindPortis the same port, frps We will analyze the protocol of the connection and then perform different treatments.

For example, in certain network environments with strict restrictions, it is possible to bindPortandvhostHTTPSPortare both set to 443.

It should be noted that if you want to combinevhostHTTPSPortwith bindPortIf the Configuration is the same port, you need to first set the transport. tls. disableCustomimTLSFirstByte Set to false.

Speed limit

Agent Speed Limit

Currently, it supports setting up agents in the Agent Configuration of the client Level speed limit, which limits the bandwidth that a single proxy can occupy.

# frpc.toml
    [[proxies]]
    name = "ssh"
    type = "tcp"
    localPort = 22
    remotePort = 6000
    transport.bandwidthLimit = "1MB"
    

Add in Agent Configuration transport. bandwidthLimit Enable this feature in the field, currently only supportsMBand KBUnit.

The speed limit capability is implemented by default on the client. If you want to enable Server side Speed limit, additional Configuration required transport. bandwidthLimitMode="a; Server".

Last modified November 15, 2023: fix 404 (#71) (626ce4d)