跳转至

Frp v0.27.0 vs v0.66.0 版本差异对比

快速对比总览

对比项 v0.27.0 v0.66.0 影响程度
发布时间 2020 年初 2025 年初 -
配置文件 INI 格式 TOML 格式 ⭐⭐⭐
认证方式 token auth.token ⭐⭐
Dashboard 基础界面 现代化 UI
客户端管理 clientID 唯一标识 ⭐⭐
代理开关 enabled 启用/禁用 ⭐⭐
HTTPS 负载均衡 ❌ 不支持 ✅ 支持 ⭐⭐⭐
功能开关 ❌ 无 ✅ Feature Gates

一、配置文件格式差异

文件格式

版本 格式 示例
v0.27.0 INI frps.ini, frpc.ini
v0.66.0 TOML frps.toml, frpc.toml

配置语法对比

INI
1
2
3
4
5
6
7
8
9
# v0.27.0 (INI)
[common]
bind_port = 7000
token = your_token

[ssh]
type = tcp
local_port = 22
remote_port = 6000
TOML
# v0.66.0 (TOML)
bindPort = 7000

[auth]
token = "your_token"

[[proxies]]
name = "ssh"
type = "tcp"
localPort = 22
remotePort = 6000

命名规范变化

v0.27.0 v0.66.0 说明
bind_port bindPort 下划线 → 驼峰
kcp_bind_port kcpBindPort 下划线 → 驼峰
vhost_http_port vhostHTTPPort 下划线 → 驼峰
dashboard_port webServer.port 结构体嵌套
log_file log.to 结构体嵌套
log_level log.level 结构体嵌套
server_addr serverAddr 下划线 → 驼峰
local_ip localIP 下划线 → 驼峰
local_port localPort 下划线 → 驼峰
remote_port remotePort 下划线 → 驼峰
custom_domains customDomains 下划线 → 驼峰

二、服务端配置差异

基础配置对比

配置项 v0.27.0 v0.66.0
监听地址 bind_addr = 0.0.0.0 bindAddr = "0.0.0.0"
通信端口 bind_port = 7000 bindPort = 7000
KCP 端口 kcp_bind_port = 7000 kcpBindPort = 7000
QUIC 端口 quic_bind_port = 7001 quicBindPort = 7001

代理端口配置

配置项 v0.27.0 v0.66.0
HTTP 端口 vhost_http_port = 80 vhostHTTPPort = 80
HTTPS 端口 vhost_https_port = 443 vhostHTTPSPort = 443
TCP 复用 tcp_mux = true tcpMux = true

Dashboard 配置

配置项 v0.27.0 v0.66.0
监听地址 dashboard_addr = 0.0.0.0 webServer.addr = "0.0.0.0"
监听端口 dashboard_port = 7500 webServer.port = 5500
用户名 dashboard_user = admin webServer.user = "admin"
密码 dashboard_pwd = admin webServer.password = "admin"
SSL 证书 ❌ 不支持 webServer.tls.certFile

日志配置

配置项 v0.27.0 v0.66.0
日志文件 log_file = ./frps.log log.to = "/var/log/frps.log"
日志级别 log_level = info log.level = "info"
保留天数 log_max_days = 3 log.maxDays = 7
禁用颜色 disable_log_color = false log.disablePrintColor = false

认证配置

配置项 v0.27.0 v0.66.0
Token token = xxx auth.token = "xxx"
认证超时 authentication_timeout = 900 ❌ 移除
心跳认证 authenticate_heartbeats = false auth.additionalScopes
OIDC 认证 ❌ 不支持 [auth.oidc]

连接限制

配置项 v0.27.0 v0.66.0
连接池 max_pool_count = 5 maxPoolCount = 5
端口限制 max_ports_per_client = 0 maxPortsPerClient = 0
允许端口 allow_ports = 445,5001-5100 allowPorts = [{start=5002,end=5100}]
特权模式 privilege_mode = false ❌ 移除

子域名配置

配置项 v0.27.0 v0.66.0
子域名主机 subdomain_host = example.com subDomainHost = "example.com"

三、客户端配置差异

基础配置对比

配置项 v0.27.0 v0.66.0
服务端地址 server_addr = x.x.x.x serverAddr = "x.x.x.x"
服务端端口 server_port = 7000 serverPort = 7000
客户端 ID ❌ 不支持 clientID = "unique-001"
登录失败退出 login_fail_exit = true loginFailExit = true
通信协议 protocol = tcp transport.protocol = "tcp"

Admin API 配置

配置项 v0.27.0 v0.66.0
监听地址 admin_addr = 127.0.0.1 webServer.addr = "0.0.0.0"
监听端口 admin_port = 7400 webServer.port = 5400
用户名 admin_user = admin webServer.user = "admin"
密码 admin_pwd = admin webServer.password = "admin"

传输配置

配置项 v0.27.0 v0.66.0
心跳间隔 heartbeat_interval = 30 transport.heartbeatInterval = 30
心跳超时 heartbeat_timeout = 90 transport.heartbeatTimeout = 90
连接池 pool_count = 1 transport.poolCount = 1
TCP 复用 tcp_mux = true transport.tcpMux = true

四、代理配置差异

配置结构

INI
1
2
3
4
5
# v0.27.0
[ssh]
type = tcp
local_port = 22
remote_port = 6000
TOML
1
2
3
4
5
6
# v0.66.0
[[proxies]]
name = "ssh"
type = "tcp"
localPort = 22
remotePort = 6000

常用代理配置对比

TCP 端口映射

配置项 v0.27.0 v0.66.0
代理名称 [ssh] name = "ssh"
类型 type = tcp type = "tcp"
本地 IP local_ip = 127.0.0.1 localIP = "127.0.0.1"
本地端口 local_port = 22 localPort = 22
远程端口 remote_port = 6000 remotePort = 6000

HTTP 反向代理

配置项 v0.27.0 v0.66.0
域名配置 custom_domains = a.com,b.com customDomains = ["a.com","b.com"]
子域名 subdomain = blog subdomain = "blog"
路由位置 locations = /,/news routeByHTTPUser = "xxx"

HTTPS 反向代理

配置项 v0.27.0 v0.66.0
负载均衡 ❌ 不支持 loadBalancer.group

v0.66.0 新增代理配置

代理启用/禁用开关

TOML
1
2
3
4
5
6
7
[[proxies]]
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 6000
enabled = false  # v0.66+ 新增

负载均衡组(HTTPS 支持)

TOML
[[proxies]]
name = "web-https"
type = "https"
localIP = "127.0.0.1"
localPort = 443
customDomains = ["www.example.com"]

# v0.66+ 新增
loadBalancer.group = "web-group"
loadBalancer.groupKey = "secret-key"

健康检查配置

INI
1
2
3
4
5
6
# v0.27.0
health_check_type = http
health_check_url = /status
health_check_interval_s = 10
health_check_max_failed = 3
health_check_timeout_s = 2
TOML
1
2
3
4
5
6
# v0.66.0
healthCheck.type = "http"
healthCheck.path = "/status"
healthCheck.intervalSeconds = 10
healthCheck.maxFailed = 3
healthCheck.timeoutSeconds = 2

元数据和注解

TOML
# v0.66+ 新增
[[proxies]]
name = "web"
type = "http"
localIP = "127.0.0.1"
localPort = 80

# 元数据
metadatas.key1 = "value1"

# 注解
annotations."k8s.io/service-name" = "my-service"

插件配置

INI
1
2
3
4
5
6
7
# v0.27.0
[plugin_http_proxy]
type = tcp
remote_port = 6002
plugin = http_proxy
plugin_http_user = abc
plugin_http_passwd = abc
TOML
# v0.66.0
[[proxies]]
name = "http-proxy"
type = "tcp"
remotePort = 6002

[proxies.plugin]
type = "http_proxy"
httpUser = "abc"
httpPassword = "abc"

五、v0.66.0 独有功能

客户端唯一标识(clientID)

TOML
# v0.66.0
clientID = "unique-client-001"

作用

  • 服务端 Dashboard 可查看所有客户端状态
  • 支持连接历史追踪
  • 多客户端管理

v0.27.0: ❌ 不支持

功能开关机制(Feature Gates)

TOML
1
2
3
# v0.66.0
[featureGates]
VirtualNet = false
功能 说明 状态
VirtualNet 虚拟网络,TUN 设备 Layer 3 连通性 Alpha

v0.27.0: ❌ 不支持

虚拟网络(VirtualNet)

TOML
1
2
3
4
5
6
# v0.66.0
[featureGates]
VirtualNet = true

[virtualNet]
# TUN 设备配置

作用

  • 创建 TUN 设备
  • 实现 Layer 3 网络互通
  • 支持 Linux/macOS,需 root 权限

v0.27.0: ❌ 不支持

动态令牌认证(OIDC tokenSource)

TOML
1
2
3
4
# v0.66.0
[auth.oidc]
tokenSource.type = "exec"
tokenSource.command = "aws cli token get"

作用

  • 从文件或外部命令动态获取令牌
  • 支持云 CLI、密钥管理器集成
  • 避免硬编码 token

v0.27.0: ❌ 不支持

Store 内置存储

TOML
1
2
3
# v0.66.0
[store]
path = "/var/lib/frpc/store"

作用

  • 持久化存储代理配置
  • 支持运行时 reload
  • Dashboard 可视化管理

v0.27.0: ❌ 不支持

智能重连(指数退避)

TOML
# v0.66.0 自动启用
# 重连间隔:60s → 300s(最大)

作用

  • 连接错误时智能退避
  • 减少不必要的重连尝试
  • 正常断开仍快速重连(10s)

v0.27.0: ❌ 不支持(固定间隔重连)

六、Dashboard 界面对比

界面风格

版本 界面 功能
v0.27.0 基础 Bootstrap 查看代理状态、流量统计
v0.66.0 现代化 UI 暗黑模式、客户端管理、Store 管理

功能对比

功能 v0.27.0 v0.66.0
代理状态查看
流量统计
客户端列表 ✅(按 clientID)
在线/离线状态 基础 详细(连接历史)
Store 管理
暗黑模式
移动端适配

七、启动命令对比

启动命令

Bash
1
2
3
4
5
6
# 两者相同
./frps -c ./frps.ini     # v0.27.0
./frps -c ./frps.toml    # v0.66.0

./frpc -c ./frpc.ini     # v0.27.0
./frpc -c ./frpc.toml    # v0.66.0

配置验证

Bash
1
2
3
# 两者相同
./frps -c ./frps.ini --verify
./frpc -c ./frpc.ini --verify

热重载

Bash
1
2
3
4
5
# v0.27.0
curl http://127.0.0.1:7400/api/reload

# v0.66.0
curl http://127.0.0.1:5400/api/reload

八、Systemd 服务配置对比

服务端服务

INI
1
2
3
4
5
# v0.27.0
ExecStart=/opt/frp/frps -c /opt/frp/frps.ini

# v0.66.0
ExecStart=/opt/frp/frps -c /opt/frp/frps.toml

客户端服务

INI
1
2
3
4
5
# v0.27.0
ExecStart=/opt/frp/frpc -c /opt/frp/frpc.ini

# v0.66.0
ExecStart=/opt/frp/frpc -c /opt/frp/frpc.toml

九、升级注意事项

配置迁移步骤

  1. 备份原配置

    Bash
    cp frps.ini frps.ini.bak
    cp frpc.ini frpc.ini.bak
    
  2. 转换配置格式

    • INI → TOML
    • 下划线 → 驼峰
    • 结构体嵌套
  3. 验证新配置

    Bash
    ./frps -c ./frps.toml --verify
    ./frpc -c ./frpc.toml --verify
    
  4. 重启服务

    Bash
    systemctl restart frps
    systemctl restart frpc
    

兼容性说明

项目 说明
服务端升级 先升级服务端,再升级客户端
客户端升级 低版本客户端可连接高版本服务端
配置文件 不兼容,需手动转换
Token 认证 兼容,token 格式不变
代理配置 功能兼容,格式需转换

升级风险

风险 解决方案
配置格式错误 升级前验证配置
功能不兼容 检查 Feature Gates
Dashboard 变更 更新访问端口
日志路径变更 检查 log.to

十、选择建议

继续使用 v0.27.0 的场景

  • ✅ 公司生产环境,稳定运行中
  • ✅ 不需要新功能
  • ✅ 避免变更风险

升级到 v0.66.0 的场景

  • ✅ 需要 HTTPS 负载均衡
  • ✅ 需要多客户端管理
  • ✅ 需要现代化 Dashboard
  • ✅ 个人/测试环境

推荐策略

环境 建议
公司生产 保持 v0.27.0,稳定优先
个人使用 升级 v0.66.0,功能丰富
新项目 直接 v0.66.0

总结

对比维度 v0.27.0 v0.66.0
稳定性 ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐
功能性 ⭐⭐⭐ ⭐⭐⭐⭐⭐
易用性 ⭐⭐⭐ ⭐⭐⭐⭐
性能 ⭐⭐⭐⭐ ⭐⭐⭐⭐⭐
学习成本 中(配置格式变化)

结论

  • v0.27.0:稳定可靠,适合生产环境
  • v0.66.0:功能强大,适合新项目和测试环境