mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[PR #4973] [CLOSED] feat(vhost): add customResponse config for unregistered HTTP hostnames #5090
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#5090
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fatedier/frp/pull/4973
Author: @mnasruul
Created: 9/8/2025
Status: ❌ Closed
Base:
dev← Head:dev📝 Commits (3)
d63f7fd[ADD] feature vHost customResponse9ac0c7d[UPDATE] log level vhost custom responseb504723feat(vhost): add customResponse config example with explanations in frps.toml📊 Changes
6 files changed (+234 additions, -0 deletions)
View changed files
📝
conf/frps_full_example.toml(+57 -0)📝
pkg/config/v1/server.go(+15 -0)📝
pkg/util/http/http.go(+23 -0)📝
pkg/util/vhost/http.go(+5 -0)📝
pkg/util/vhost/resource.go(+114 -0)📝
server/service.go(+20 -0)📄 Description
Summary
This PR introduces a new customResponse configuration block in FRPS.
When a client sends an HTTP request with a Host that is not registered by any FRPC, FRPS can now return a custom response instead of the default 404 page.
Why
Currently, unregistered host requests always return the same default 404 response.
With customResponse, users can define:
This improves:
Configuration Example (frps.toml)
Notes:
Rules are matched in order; first match wins.
Design Overview
Compatibility
Test Plan
Manual curl tests against FRPS with/without enabled rules.
Related Issue
Closes https://github.com/fatedier/frp/issues/4972
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.