PaperMC / PaperMC/Velocity

[Feature Request] Wildcard Forced Host Support

Open
#1,587 1 comment 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: feature
Dominant language
Java
Stars
2.3k
Forks
959
Avg merge
5d 10h
Merged PRs (30d)
2

Description

Requested Feature

Make the [forced-hosts] domains support wildwards (ie. *.example.com) rather than having to statically define subdomains (play.example.com)

Why is this needed?

Most forced host systems in software allow for wildcard support already and this allows for networks looking to bundle a vast majority of subdomains for different IPs into singular wildcards.

For example, this is my current setup without wildcards:

[forced-hosts]
# Configure your forced hosts here.

# Soul Realms
"play.soulrealms.net" = ["soulrealms-smp-1" ]
"yt.soulrealms.net" = [ "soulrealms-smp-1" ]
"ip.soulrealms.net" = [ "soulrealms-smp-1" ]
"soulrealms.net" = ["soulrealms-smp-1" ]
"soulrealms.minehut.gg" = [ "soulrealms-smp-1" ]

# Misc PvP
"play.miscpvp.org" = [ "miscpvp-gens-1" ]
"yt.miscpvp.org" = [ "miscpvp-gens-1" ]
"miscpvp.org" = [ "miscpvp-gens-1" ]
"ip.miscpvp.org" = [ "miscpvp-gens-1" ]
"miscpvp.minehut.gg" = [ "miscpvp-gens-1" ]

This discourages IP-based join tracking and forces players to be sent to a hub server rather than forwarded directly if their IP differs from the configured list. With wildcards, this would become:

[forced-hosts]
# Configure your forced hosts here.

# Soul Realms
"*.soulrealms.net" = [ "soulrealms-smp-1" ]
"soulrealms.net" = ["soulrealms-smp-1" ]
"soulrealms.minehut.gg" = [ "soulrealms-smp-1" ]

# Misc PvP
"*.miscpvp.org" = [ "miscpvp-gens-1" ]
"miscpvp.org" = [ "miscpvp-gens-1" ]
"miscpvp.minehut.gg" = [ "miscpvp-gens-1" ]

Allowing users to use enhanced subdomain tracking without sending someone to an arbitrary hub server due to not knowing where to forward the player.

Alternative Solutions

Only alternative solution is to manually define each and every potential subdomain a player could join with, which can be clunky and bolsters line count significantly.

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name files or tests; begin by locating the parser and matcher for the [forced-hosts] configuration. Verify wildcard entries such as *.example.com against subdomains while preserving exact host entries, and add or update coverage showing the expected matching behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
networking
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.