[PR #5276] [CLOSED] Implement a simple 'strip prefix' feature for http locations #5224

Closed
opened 2026-05-05 14:57:03 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/5276
Author: @cayspekko
Created: 4/3/2026
Status: Closed

Base: devHead: upstream/dev


📝 Commits (2)

  • 9a633ea Implement a simple 'strip prefix' feature for http locations
  • cf6a423 fixes unknown manifest

📊 Changes

8 files changed (+174 additions, -0 deletions)

View changed files

📝 .github/workflows/build-and-push-image.yml (+2 -0)
📝 pkg/config/v1/proxy.go (+3 -0)
📝 pkg/msg/msg.go (+1 -0)
📝 pkg/util/vhost/http.go (+8 -0)
pkg/util/vhost/http_test.go (+107 -0)
📝 pkg/util/vhost/vhost.go (+1 -0)
📝 server/proxy/http.go (+1 -0)
📝 test/e2e/v1/basic/http.go (+51 -0)

📄 Description

WHY

Though frpproxy isn't meant to be a full blown L7 reverse proxy, this particular feature is useful if you use multiple dynamic paths on the server, but you don't want to hassle with url prefix logic on your http client. Especially useful for http clients that serve pure json apis. In my particular case, I cannot use domain based identifiers. Fit's naturally with the "locations" setting, and thus it only strips those particularly prefixes as they are defined.

Example:

serverAddr = "example.com"
serverPort = 7000

[[proxies]]
name = "fast"
type = "http"
localIP = "127.0.0.1"
localPort = 5000
customDomains = ["example.com"]
locations = ["/example"]
stripPrefix = true

relates to https://github.com/fatedier/frp/issues/4981


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fatedier/frp/pull/5276 **Author:** [@cayspekko](https://github.com/cayspekko) **Created:** 4/3/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `upstream/dev` --- ### 📝 Commits (2) - [`9a633ea`](https://github.com/fatedier/frp/commit/9a633ea03e479415ff3fca6e3a9f9803af77e0db) Implement a simple 'strip prefix' feature for http locations - [`cf6a423`](https://github.com/fatedier/frp/commit/cf6a4239b513a380128631bda6c9117be7246ea7) fixes unknown manifest ### 📊 Changes **8 files changed** (+174 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/build-and-push-image.yml` (+2 -0) 📝 `pkg/config/v1/proxy.go` (+3 -0) 📝 `pkg/msg/msg.go` (+1 -0) 📝 `pkg/util/vhost/http.go` (+8 -0) ➕ `pkg/util/vhost/http_test.go` (+107 -0) 📝 `pkg/util/vhost/vhost.go` (+1 -0) 📝 `server/proxy/http.go` (+1 -0) 📝 `test/e2e/v1/basic/http.go` (+51 -0) </details> ### 📄 Description ### WHY Though frpproxy isn't meant to be a full blown L7 reverse proxy, this particular feature is useful if you use multiple dynamic paths on the server, but you don't want to hassle with url prefix logic on your http client. Especially useful for http clients that serve pure json apis. In my particular case, I cannot use domain based identifiers. Fit's naturally with the "locations" setting, and thus it only strips those particularly prefixes as they are defined. Example: ```toml serverAddr = "example.com" serverPort = 7000 [[proxies]] name = "fast" type = "http" localIP = "127.0.0.1" localPort = 5000 customDomains = ["example.com"] locations = ["/example"] stripPrefix = true ``` relates to https://github.com/fatedier/frp/issues/4981 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 14:57:03 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#5224
No description provided.