[PR #1401] [MERGED] Pass client configuration as an argument #4379

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

📋 Pull Request Information

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

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


📝 Commits (1)

  • 666f122 Pass client configuration as an argument

📊 Changes

19 files changed (+162 additions, -164 deletions)

View changed files

📝 client/admin.go (+1 -2)
📝 client/admin_api.go (+18 -19)
📝 client/control.go (+20 -11)
📝 client/proxy/proxy.go (+13 -10)
📝 client/proxy/proxy_manager.go (+14 -7)
📝 client/proxy/proxy_wrapper.go (+2 -2)
📝 client/service.go (+26 -17)
📝 client/visitor.go (+2 -3)
📝 cmd/frpc/sub/http.go (+2 -2)
📝 cmd/frpc/sub/https.go (+2 -2)
📝 cmd/frpc/sub/reload.go (+7 -8)
📝 cmd/frpc/sub/root.go (+35 -35)
📝 cmd/frpc/sub/status.go (+7 -8)
📝 cmd/frpc/sub/stcp.go (+2 -2)
📝 cmd/frpc/sub/tcp.go (+2 -2)
📝 cmd/frpc/sub/udp.go (+2 -2)
📝 cmd/frpc/sub/xtcp.go (+2 -2)
g/g.go (+0 -22)
📝 models/config/client_common.go (+5 -8)

📄 Description

The ClientCommonConf, configuration file path, and server UDP port are now passed around as arguments instead of being shared between components as global variables. This allows for multiple clients to exist in the same process, and allows client.Session to be used as a library more easily.

This is similar to #1396 but for the client side, and comes with the same caveats.

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/1401 **Author:** [@velovix](https://github.com/velovix) **Created:** 8/20/2019 **Status:** ✅ Merged **Merged:** 8/21/2019 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `issue-1387_client-conf-as-argument` --- ### 📝 Commits (1) - [`666f122`](https://github.com/fatedier/frp/commit/666f122a72e6a1fb3bbc42639577f09607c6c443) Pass client configuration as an argument ### 📊 Changes **19 files changed** (+162 additions, -164 deletions) <details> <summary>View changed files</summary> 📝 `client/admin.go` (+1 -2) 📝 `client/admin_api.go` (+18 -19) 📝 `client/control.go` (+20 -11) 📝 `client/proxy/proxy.go` (+13 -10) 📝 `client/proxy/proxy_manager.go` (+14 -7) 📝 `client/proxy/proxy_wrapper.go` (+2 -2) 📝 `client/service.go` (+26 -17) 📝 `client/visitor.go` (+2 -3) 📝 `cmd/frpc/sub/http.go` (+2 -2) 📝 `cmd/frpc/sub/https.go` (+2 -2) 📝 `cmd/frpc/sub/reload.go` (+7 -8) 📝 `cmd/frpc/sub/root.go` (+35 -35) 📝 `cmd/frpc/sub/status.go` (+7 -8) 📝 `cmd/frpc/sub/stcp.go` (+2 -2) 📝 `cmd/frpc/sub/tcp.go` (+2 -2) 📝 `cmd/frpc/sub/udp.go` (+2 -2) 📝 `cmd/frpc/sub/xtcp.go` (+2 -2) ➖ `g/g.go` (+0 -22) 📝 `models/config/client_common.go` (+5 -8) </details> ### 📄 Description The ClientCommonConf, configuration file path, and server UDP port are now passed around as arguments instead of being shared between components as global variables. This allows for multiple clients to exist in the same process, and allows client.Session to be used as a library more easily. This is similar to #1396 but for the client side, and comes with the same caveats. 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:59 -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#4379
No description provided.