代理协议支持
Proxy Protocol Support 是一个 Fabric 和 Quilt 模组,为您的 Minecraft 服务器添加了 Proxy Protocol (HAProxy) 支持。它允许同时接受代理连接和直接连接。
例如,您可以使用 TCPShield 或其他软件(Nginx、FRP)来转发流量,并隐藏服务器的 IP 地址。如果没有 Proxy Protocol,控制台将仅显示代理的 IP 地址。通过读取 Proxy Protocol 数据包,此模组使得显示玩家真实 IP 地址成为可能。
这是一个仅服务端模组;安装在客户端上时没有任何作用。
支持 Minecraft 版本 1.14-26.1 及更高版本(未经测试)。
安全混合模式
此模组允许您的 Minecraft 服务器同时接受来自可信代理(使用 PROXY 协议)和可信直连 IP 的连接。这对于希望将服务器 IP 隐藏在代理后面,同时仍允许管理员或本地玩家直接连接的设置非常完美。
模组遵循安全的**“默认拒绝”原则。如果传入连接的 IP 地址未明确列入以下任一白名单中,它将被拒绝**。这可以防止未经授权的用户绕过代理并直接连接到您服务器的真实 IP 地址。
配置
配置文件位于 config/proxy_protocol_support.json。
enableProxyProtocol
设置为 true 以启用模组功能。
- 默认值:
true
proxyServerIPs
受信任的代理服务器 IP 地址列表。来自这些 IP 的连接必须发送 PROXY Protocol 头部。
- 默认值:
["127.0.0.1"]
directAccessIPs
允许无需 PROXY Protocol 头部即可直接连接的 IP 或 CIDR 范围列表。这非常适合管理员、局域网玩家和服务端工具。
- 默认值:
["127.0.0.1", "192.168.0.0/16"]
whitelistTCPShieldServers
当为 true 时,模组会自动获取 TCPShield 的官方代理 IP 并将其添加到受信任的 proxyServerIPs 列表中。
- 默认值:
false
示例场景
场景 1:同一台机器上的 FRP 后方的服务器
您在与 Minecraft 服务器相同的机器上运行 frpc。来自互联网的玩家通过代理连接。您希望从同一局域网 (192.168.1.100) 上的游戏 PC 直接连接。
proxyServerIPs = ["127.0.0.1"]
directAccessIPs = ["127.0.0.1", "192.168.1.100"]
场景 2:由远程代理服务保护的服务器
您的服务器在家里,您使用 IP 为 203.0.113.10 的 VPS 作为代理。您希望整个家庭网络 (192.168.0.0/24) 拥有直接访问权限。
proxyServerIPs = ["203.0.113.10"]
directAccessIPs = ["127.0.0.1", "192.168.0.0/24"]
场景 3:最高安全性(仅限代理)
您只希望通过代理允许连接,而不允许其他任何连接(甚至不包括来自本地机器的连接)。
proxyServerIPs = ["1.2.3.4", "5.6.7.8"] # 您的代理 IP
directAccessIPs = [] # 留空
正在寻找 Minecraft 服务器?请访问 BedrockHost.pl
Proxy Protocol Support
Proxy Protocol Support is a Fabric and Quilt mod which adds support for Proxy Protocol (HAProxy) for your Minecraft server. It allows to accept both proxied and direct connections simultaneously.
For example you can use TCPShield or other software (Nginx, FRP) to forward traffic, and hide your server's IP address. Without Proxy Protocol, your console will only show the proxy's IP address. By reading the Proxy Protocol packet, this mod makes showing the player's real IP address possible.
This is a Server-Side only mod; it does nothing when installed on a client.
Supports Minecraft versions 1.14-26.1 and probably later (untested).
Secure Hybrid Mode
This mod allows your Minecraft server to simultaneously accept connections from a trusted proxy (using the PROXY protocol) and from trusted direct-access IPs. This is perfect for setups where you want to hide your server's IP behind a proxy, while still allowing admins or local players to connect directly.
The mod operates on a secure "Default Deny" principle. If an incoming connection's IP address is not explicitly whitelisted in one of the lists below, it will be rejected. This prevents unauthorized users from bypassing your proxy and connecting directly to your server's real IP address.
Configuration
Configuration is handled in config/proxy_protocol_support.json.
enableProxyProtocol
Set to true to enable the mod's functionality.
- Default:
true
proxyServerIPs
A list of IP addresses that are your trusted proxy servers. Connections from these IPs must send a PROXY Protocol header.
- Default:
["127.0.0.1"]
directAccessIPs
A list of IPs or CIDR ranges that are allowed to connect directly without a PROXY Protocol header. This is ideal for admins, local network players, and server-side tools.
- Default:
["127.0.0.1", "192.168.0.0/16"]
whitelistTCPShieldServers
When true, the mod automatically fetches TCPShield's official proxy IPs and adds them to the trusted proxyServerIPs list.
- Default:
false
Example Scenarios
Scenario 1: Server behind FRP on the same machine
You run frpc on the same machine as the Minecraft server. Players from the internet connect through the proxy. You want to connect directly from your gaming PC on the same LAN (192.168.1.100).
proxyServerIPs = ["127.0.0.1"]
directAccessIPs = ["127.0.0.1", "192.168.1.100"]
Scenario 2: Server protected by a remote proxy service
Your server is at home, and you use a VPS with the IP 203.0.113.10 as a proxy. You want your entire home network (192.168.0.0/24) to have direct access.
proxyServerIPs = ["203.0.113.10"]
directAccessIPs = ["127.0.0.1", "192.168.0.0/24"]
Scenario 3: Maximum Security (Proxy Only)
You only want to allow connections through your proxies and nothing else (not even from the local machine).
proxyServerIPs = ["1.2.3.4", "5.6.7.8"] # Your proxy IPs
directAccessIPs = [] # Leave empty
Looking for Minecraft server? Visit BedrockHost.pl
下载 Proxy Protocol Support
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Proxy Protocol Support
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Proxy Protocol Support
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Proxy Protocol Support
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Proxy Protocol Support
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Proxy Protocol Support
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Proxy Protocol Support
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Proxy Protocol Support
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Proxy Protocol Support
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
修复 #55
- 修复了 IPv6 CIDR 匹配问题——/32 被当作完整掩码处理,无论地址族如何,导致 IPv6 地址的前缀匹配失效
- 添加了混合连接模式——当某个 IP 同时存在于 proxyServerIPs 和 directAccessIPs 列表中时,模组现在会在运行时检测 PROXY 协议头,并据此正确处理连接
- 为 CIDRMatcher 添加了单元测试
- 将 Netty HAProxy 编解码器更新至 4.2.13.Final
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
模组
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
评论 0
登录后参与评分
还没有评论,来抢沙发吧