mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 12:40:11 +00:00
support vless for sing
This commit is contained in:
@@ -13,16 +13,25 @@ import (
|
||||
func (b *Box) AddUsers(p *core.AddUsersParams) (added int, err error) {
|
||||
switch p.NodeInfo.Type {
|
||||
case "v2ray":
|
||||
us := make([]option.VMessUser, len(p.UserInfo))
|
||||
for i := range p.UserInfo {
|
||||
us[i] = option.VMessUser{
|
||||
Name: p.UserInfo[i].Uuid,
|
||||
UUID: p.UserInfo[i].Uuid,
|
||||
if p.NodeInfo.ExtraConfig.EnableVless == "true" {
|
||||
us := make([]option.VLESSUser, len(p.UserInfo))
|
||||
for i := range p.UserInfo {
|
||||
us[i] = option.VLESSUser{
|
||||
Name: p.UserInfo[i].Uuid,
|
||||
Flow: p.NodeInfo.ExtraConfig.VlessFlow,
|
||||
UUID: p.UserInfo[i].Uuid,
|
||||
}
|
||||
}
|
||||
}
|
||||
err = b.inbounds[p.Tag].(*inbound.VMess).AddUsers(us)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
err = b.inbounds[p.Tag].(*inbound.VLESS).AddUsers(us)
|
||||
} else {
|
||||
us := make([]option.VMessUser, len(p.UserInfo))
|
||||
for i := range p.UserInfo {
|
||||
us[i] = option.VMessUser{
|
||||
Name: p.UserInfo[i].Uuid,
|
||||
UUID: p.UserInfo[i].Uuid,
|
||||
}
|
||||
}
|
||||
err = b.inbounds[p.Tag].(*inbound.VMess).AddUsers(us)
|
||||
}
|
||||
case "shadowsocks":
|
||||
us := make([]option.ShadowsocksUser, len(p.UserInfo))
|
||||
@@ -33,6 +42,9 @@ func (b *Box) AddUsers(p *core.AddUsersParams) (added int, err error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return len(p.UserInfo), err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user