mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 12:40:11 +00:00
Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # conf/node.go
This commit is contained in:
@@ -90,6 +90,7 @@ func BuildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag s
|
||||
}
|
||||
default:
|
||||
// Normal tls
|
||||
in.StreamSetting.Security = "tls"
|
||||
in.StreamSetting.TLSSettings = &coreConf.TLSConfig{
|
||||
Certs: []*coreConf.TLSCertConfig{
|
||||
{
|
||||
@@ -102,6 +103,25 @@ func BuildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag s
|
||||
}
|
||||
}
|
||||
}
|
||||
// use remote reality replace local config
|
||||
if nodeInfo.ExtraConfig.EnableReality {
|
||||
rc := nodeInfo.ExtraConfig.RealityConfig
|
||||
in.StreamSetting.Security = "reality"
|
||||
d, err := json.Marshal(rc.Dest)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("marshal reality dest error: %s", err)
|
||||
}
|
||||
in.StreamSetting.REALITYSettings = &coreConf.REALITYConfig{
|
||||
Dest: d,
|
||||
Xver: rc.Xver,
|
||||
ServerNames: rc.ServerNames,
|
||||
PrivateKey: rc.PrivateKey,
|
||||
MinClientVer: rc.MinClientVer,
|
||||
MaxClientVer: rc.MaxClientVer,
|
||||
MaxTimeDiff: rc.MaxTimeDiff,
|
||||
ShortIds: rc.ShortIds,
|
||||
}
|
||||
}
|
||||
// Support ProxyProtocol for any transport protocol
|
||||
if *in.StreamSetting.Network != "tcp" &&
|
||||
*in.StreamSetting.Network != "ws" &&
|
||||
@@ -117,7 +137,8 @@ func BuildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag s
|
||||
}
|
||||
|
||||
func buildV2ray(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, inbound *coreConf.InboundDetourConfig) error {
|
||||
if config.XrayOptions.EnableVless {
|
||||
if config.XrayOptions.EnableVless ||
|
||||
nodeInfo.ExtraConfig.EnableVless {
|
||||
//Set vless
|
||||
inbound.Protocol = "vless"
|
||||
if config.XrayOptions.EnableFallback {
|
||||
|
||||
@@ -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),
|
||||
@@ -93,7 +89,7 @@ func BuildSSUser(tag string, userInfo *panel.UserInfo, cypher string, serverKey
|
||||
}
|
||||
return &protocol.User{
|
||||
Level: 0,
|
||||
Email: tag,
|
||||
Email: BuildUserTag(tag, userInfo.Uuid),
|
||||
Account: serial.ToTypedMessage(ssAccount),
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user