[PR #1396] [MERGED] Pass server configuration as an argument #4376

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

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/1396
Author: @velovix
Created: 8/19/2019
Status: Merged
Merged: 8/20/2019
Merged by: @fatedier

Base: devHead: issue-1387_server-conf-as-argument


📝 Commits (2)

  • 6277af4 Pass server configuration as an argument
  • 5fc7b3c Remove global ServerService variable

📊 Changes

14 files changed (+117 additions, -149 deletions)

View changed files

📝 cmd/frps/root.go (+40 -44)
📝 g/g.go (+0 -10)
📝 go.sum (+2 -0)
📝 models/config/proxy.go (+18 -18)
📝 models/config/server_common.go (+5 -23)
📝 server/control.go (+16 -12)
📝 server/dashboard.go (+1 -2)
📝 server/dashboard_api.go (+9 -11)
📝 server/proxy/http.go (+4 -5)
📝 server/proxy/https.go (+3 -4)
📝 server/proxy/proxy.go (+7 -6)
📝 server/proxy/tcp.go (+2 -3)
📝 server/proxy/udp.go (+1 -2)
📝 server/service.go (+9 -9)

📄 Description

The ServerCommonConf is now passed around as an argument instead of being shared between components as a global variable. This allows for more natural interaction with server.Session as a library and allows for multiple servers to co-exist within the same process.

This on its own is not an ideal solution because a lot more information is being passed around than is necessary. Splitting up this configuration information may be done as a future step by @fatedier.

Related: #1387


🔄 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/1396 **Author:** [@velovix](https://github.com/velovix) **Created:** 8/19/2019 **Status:** ✅ Merged **Merged:** 8/20/2019 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `issue-1387_server-conf-as-argument` --- ### 📝 Commits (2) - [`6277af4`](https://github.com/fatedier/frp/commit/6277af47902358bfd53acb0013b9a6cdbde0d648) Pass server configuration as an argument - [`5fc7b3c`](https://github.com/fatedier/frp/commit/5fc7b3ceb5b208100a59c93c98790abeebee948f) Remove global ServerService variable ### 📊 Changes **14 files changed** (+117 additions, -149 deletions) <details> <summary>View changed files</summary> 📝 `cmd/frps/root.go` (+40 -44) 📝 `g/g.go` (+0 -10) 📝 `go.sum` (+2 -0) 📝 `models/config/proxy.go` (+18 -18) 📝 `models/config/server_common.go` (+5 -23) 📝 `server/control.go` (+16 -12) 📝 `server/dashboard.go` (+1 -2) 📝 `server/dashboard_api.go` (+9 -11) 📝 `server/proxy/http.go` (+4 -5) 📝 `server/proxy/https.go` (+3 -4) 📝 `server/proxy/proxy.go` (+7 -6) 📝 `server/proxy/tcp.go` (+2 -3) 📝 `server/proxy/udp.go` (+1 -2) 📝 `server/service.go` (+9 -9) </details> ### 📄 Description The ServerCommonConf is now passed around as an argument instead of being shared between components as a global variable. This allows for more natural interaction with server.Session as a library and allows for multiple servers to co-exist within the same process. This on its own is not an ideal solution because a lot more information is being passed around than is necessary. Splitting up this configuration information may be done as a future step by @fatedier. Related: #1387 --- <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:40:55 -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#4376
No description provided.