mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #1988] 如何添加新的负载均衡的策略 #1583
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#1583
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?
Originally created by @junit on GitHub (Sep 17, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1988
希望能够控制负载均衡的策略,请问有什么方法可以实现吗。
@fatedier commented on GitHub (Sep 18, 2020):
这个方面目前只支持最简单的轮询,以后会考虑增加一些常见的策略,不知道你希望使用的是哪种策略?
@junit commented on GitHub (Sep 19, 2020):
我希望可以根据用户名分割出业务字段,通过业务字段控制负载策略。
比如格式:{用户名}-{sessionId}
通过sessionId来控制固定路由到同一个客户端中。
// 伪代码
m := map[string] // 带自动时间过期特性的map
client, ok := m[sessionId]
if !ok {
client = 随机分配一个client
m[sessionId] = client
}
@fatedier commented on GitHub (Sep 21, 2020):
你这个还是比较定制化的,不是很通用,短期内应该没有办法支持。类似的需求你可以直接 fork 代码在代码中修改,按照自己的业务逻辑来定制。
@rty813 commented on GitHub (Jan 23, 2021):
引用一下goproxy的负载均衡策略: