HAProxyDetector
一款轻量级插件,旨在 Paper/Folia 和 Velocity 上同时支持原生 HAProxy/Proxy Protocol 以及直连玩家连接。
主要特性
- 混合连接支持:同时处理真实的 HAProxy/frp 代理流量与直接玩家连接。
- 原生解析器兼容性:按连接探测协议;直接连接会绕过原生 HAProxy 解码器。
- 域名 / IP / CIDR 白名单:
whitelist支持单个 IP、CIDR 子网和域名。
支持的平台
- Paper / Folia:理论上支持任何具备原生 HAProxy/Proxy Protocol 功能的版本。
- Velocity:针对
3.3.0+设计,兼容 Velocity 4.x 当前的连接初始化架构。
配置
Paper 和 Velocity 共用相同的 config.yml 结构:
language: # 检测并保存操作系统/JVM语言;或设置为 en_US / zh_CN
enable-whitelist: true
whitelist:
- 127.0.0.1
- "::1"
- frps.example.com
- 203.0.113.0/24
白名单规则
- IP:精确匹配。
- CIDR:子网匹配,例如
203.0.113.0/24。 - 域名:在插件加载配置时自动解析为 IP 地址以参与匹配。
域名白名单注意事项
- 域名仅在插件加载或重载配置时进行解析,而非在每个连接时动态解析。
- 如果后续 DNS 解析发生变化,需要重启服务器或重载插件以刷新缓存的 IP。
- 如果某个域名暂时无法解析,插件不会启动失败。
日志行为
拦截日志字段说明:
frps:上游代理服务器的真实源 IP。client:HAProxy 头部中携带的客户端源 IP。
示例:
[HAProxyDetectorPaper] Blocked non-whitelisted frps connection: frps=91.78.69.13, client=91.78.69.13
使用方法
- 配置平台:
- Paper / Folia:在
config/paper-global.yml(新版本)或paper.yml(旧版本)中将proxy-protocol设置为true。 - Velocity:在
velocity.toml的[advanced]下将haproxy-protocol设置为true。该插件复用 Velocity 的原生 HAProxy 解码器。
- Paper / Folia:在
- 安装插件:将插件 JAR 文件放入相应平台的
plugins文件夹中。 - 配置白名单(可选):如果仅希望允许特定的 frps 来源,请在
config.yml中配置whitelist。 - 重启服务器/代理。
HAProxyDetector
A lightweight plugin designed to support both native HAProxy / Proxy Protocol and direct player connections simultaneously on Paper/Folia and Velocity.
Key Features
- Hybrid Connection Support: Simultaneously handles genuine HAProxy/frp proxy traffic and direct player connections.
- Native Parser Compatibility: Probes protocols on a per-connection basis; direct connections bypass the native HAProxy decoder directly.
- Domain / IP / CIDR Whitelisting:
whitelistsupports individual IPs, CIDR subnets, and domain names.
Supported Platforms
- Paper / Folia: Theoretically supports any version with native HAProxy / Proxy Protocol functionality.
- Velocity: Targeted at
3.3.0+, compatible with Velocity 4.x's current connection initialization architecture.
Configuration
Both Paper and Velocity share the same config.yml structure:
language: # detect and save the OS/JVM language; or set en_US / zh_CN
enable-whitelist: true
whitelist:
- 127.0.0.1
- "::1"
- frps.example.com
- 203.0.113.0/24
Whitelist Rules
- IP: Exact match.
- CIDR: Subnet matching, e.g.,
203.0.113.0/24. - Domain Name: Automatically resolved to IP addresses when the plugin loads the configuration to participate in matching.
Domain Whitelist Notes
- Domain names are resolved when the plugin loads or reloads the configuration, not dynamically on every connection.
- If DNS resolution changes later, a server restart or plugin reload is required to refresh the cached IPs.
- If a domain temporarily fails to resolve, the plugin will not fail to start.
Logging Behavior
Intercept log field descriptions:
frps: The real source IP of the upstream proxy server.client: The client source IP carried in the HAProxy header.
Example:
[HAProxyDetectorPaper] Blocked non-whitelisted frps connection: frps=91.78.69.13, client=91.78.69.13
Usage
- Configure the Platform:
- Paper / Folia: Set
proxy-protocoltotrueinconfig/paper-global.yml(newer versions) orpaper.yml(legacy versions). - Velocity: Set
haproxy-protocoltotrueunder[advanced]invelocity.toml. The plugin reuses Velocity's native HAProxy decoder.
- Paper / Folia: Set
- Install the Plugin: Place the plugin JAR into the respective platform's
pluginsfolder. - Configure Whitelist (Optional): If you only want to allow specific frps sources, configure
whitelistinconfig.yml. - Restart Server / Proxy.
下载 HAProxyDetectorPaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HAProxyDetectorPaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HAProxyDetectorPaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HAProxyDetectorPaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HAProxyDetectorPaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HAProxyDetectorPaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
暂无更新日志
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
ExyliaPlugins 的库。
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
一个在游戏内运行的 Minecraft 地图编辑器! 支持选区、蓝图、复制粘贴、笔刷和脚本。 可在创造模式中使用,也可在生存模式中临时使用。
插件
创建用户友好的菜单以前往不同的世界
插件
专为 Velocity 打造的自制聊天插件,功能丰富——支持跨服群组/全局/私聊消息,并集成 LibertyBans 的禁言功能。
插件
一个高度兼容、功能完善且稳定的 TPA 模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧