feat: per-domain backend routing
Each allowed_domains entry can now carry its own backend {host, port}.
That lets one proxy on port 25565 serve multiple MC servers, picking
the upstream from the domain the client typed.
- proxy/main.py: ProxyState.backend_for(domain) → tuple|None,
honors per-domain backend first, falls back to top-level backend.
handle_client uses backend_for(); blocked / disabled domains
return None (and still get a Login Disconnect on join attempts).
- api/routes/{config,domains}.py: DomainBackend model + optional
backend field on create/patch. PATCH supports clear_backend=true
to drop a per-domain override and revert to default.
- frontend/Domains.jsx: full rewrite — new-domain form has host/port
inputs, table shows each row's effective backend, inline edit +
reset button per row.
- frontend/Settings.jsx: backend section relabeled "기본 백엔드 (fallback)"
- README updated with multi-server example config.
This commit is contained in:
@@ -19,10 +19,16 @@ class BackendConfig(BaseModel):
|
||||
port: int = Field(ge=1, le=65535)
|
||||
|
||||
|
||||
class DomainBackend(BaseModel):
|
||||
host: str
|
||||
port: int = Field(ge=1, le=65535)
|
||||
|
||||
|
||||
class DomainEntry(BaseModel):
|
||||
domain: str
|
||||
enabled: bool = True
|
||||
note: str = ""
|
||||
backend: DomainBackend | None = None # 없으면 top-level backend 로 fallback
|
||||
|
||||
|
||||
class FullConfig(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user