use route group to storage extra config

This commit is contained in:
yuzuki999
2023-06-25 08:22:05 +08:00
parent 9af5d1a6e7
commit 07b7ec9b3e
7 changed files with 100 additions and 29 deletions

View File

@@ -14,8 +14,6 @@ import (
"strings"
)
const xtlsFLow = "xtls-rprx-vision"
func BuildVmessUsers(tag string, userInfo []panel.UserInfo) (users []*protocol.User) {
users = make([]*protocol.User, len(userInfo))
for i, user := range userInfo {
@@ -37,21 +35,19 @@ func BuildVmessUser(tag string, userInfo *panel.UserInfo) (user *protocol.User)
}
}
func BuildVlessUsers(tag string, userInfo []panel.UserInfo, xtls bool) (users []*protocol.User) {
func BuildVlessUsers(tag string, userInfo []panel.UserInfo, flow string) (users []*protocol.User) {
users = make([]*protocol.User, len(userInfo))
for i := range userInfo {
users[i] = BuildVlessUser(tag, &(userInfo)[i], xtls)
users[i] = BuildVlessUser(tag, &(userInfo)[i], flow)
}
return users
}
func BuildVlessUser(tag string, userInfo *panel.UserInfo, xtls bool) (user *protocol.User) {
func BuildVlessUser(tag string, userInfo *panel.UserInfo, flow string) (user *protocol.User) {
vlessAccount := &vless.Account{
Id: userInfo.Uuid,
}
if xtls {
vlessAccount.Flow = xtlsFLow
}
vlessAccount.Flow = flow
return &protocol.User{
Level: 0,
Email: BuildUserTag(tag, userInfo.Uuid),