A lightweight plugin for Paper/Folia and Velocity that makes native HAProxy / Proxy Protocol support compatible with normal direct player connections.
- Mixed Connection Support: Accepts real HAProxy/frp proxy traffic and normal direct player traffic at the same time.
- Native Parser Compatibility: Adds a synthetic HAProxy V2 header to direct traffic so the server can continue using its native proxy-protocol parsing flow.
- Whitelist Supports Domain / IP / CIDR:
whitelistsupports single IP entries, CIDR ranges, and domain names. - Minimal Intercept Logging: Logs when a non-whitelisted proxy connection is blocked, including the frps source IP and client IP.
- Real HAProxy traffic: If a valid HAProxy v1/v2 header is detected, it is passed directly to the server's native parser.
- Normal direct players: If no HAProxy header exists, the plugin adds a synthetic HAProxy V2 header based on the player's real socket address.
- Synthetic header protection: Internally marks self-generated headers so later whitelist checks will not mistake them for external frps traffic.
- Whitelist filtering: When
enable-whitelistis enabled, only real external proxy sources are checked.
- Paper / Folia: Theoretically supports versions with native HAProxy support.
- Velocity: Theoretically supports
3.0.0+.
Paper and Velocity use the same config.yml structure:
enable-whitelist: true
whitelist:
- 127.0.0.1
- "::1"
- frps.example.com
- 203.0.113.0/24
- IP: Exact match.
- CIDR: Network range match, for example
203.0.113.0/24. - Domain: Automatically resolved into an IP list when the plugin loads the configuration.
- Domain names are resolved when the plugin loads or reloads its configuration, not on every connection.
- If the DNS result changes later, restart or reload the plugin to refresh the resolved IP list.
- If a domain temporarily fails to resolve, the plugin will not fail to start and will keep the original config entry.
Logs are only printed when a non-whitelisted HAProxy connection is blocked.
Log fields:
frps: The real source IP of the upstream proxy server.client: The client source IP carried in the HAProxy header.
Example:
[HAProxyDetectorPaper] 拦截非白名单 frps 连接: frps=91.78.69.13, client=91.78.69.13
- Enable native HAProxy support:
- Paper / Folia: Set
proxy-protocoltotrueinconfig/paper-global.yml(newer versions) orpaper.yml(older versions). - Velocity: Set
haproxy = trueinvelocity.toml.
- Paper / Folia: Set
- Install the plugin: Put the plugin JAR into the correct platform plugin directory.
- Configure the whitelist if needed: If you only want to allow specific frps sources, edit
whitelistinconfig.yml. - Restart the server / proxy.
The plugin actively removes its injected Netty handlers during disable or shutdown, so unloading it will not continue affecting new connections. For low-level network plugins in production environments, a full restart is still the safest option.
- Netty ChannelPipeline Injection: Intercepts raw
ByteBufat the front of the network pipeline. - Feature Detection: Uses reflection to locate the server connection structure without depending on one fixed field name.
- HAProxy V2 Header Forging: Generates a standard HAProxy V2 header for direct connections.
- Synthetic Marker: Prevents self-generated headers from being checked again as external proxy traffic.