mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-12 11:29:36 +03:00
VLESS & VMess are not ready to accept FullCone yet
This commit is contained in:
24
main/run.go
24
main/run.go
@ -13,6 +13,10 @@ import (
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
"github.com/xtls/xray-core/app/proxyman"
|
||||
"github.com/xtls/xray-core/common/buf"
|
||||
"github.com/xtls/xray-core/common/cmdarg"
|
||||
"github.com/xtls/xray-core/common/platform"
|
||||
"github.com/xtls/xray-core/core"
|
||||
@ -176,6 +180,26 @@ func startXray() (core.Server, error) {
|
||||
return nil, newError("failed to load config files: [", configFiles.String(), "]").Base(err)
|
||||
}
|
||||
|
||||
v, t := false, false
|
||||
for _, outbound := range config.Outbound {
|
||||
s := strings.ToLower(outbound.ProxySettings.Type)
|
||||
l := len(s)
|
||||
if l >= 16 && s[11:16] == "vless" || l >= 16 && s[11:16] == "vmess" {
|
||||
v = true
|
||||
continue
|
||||
}
|
||||
if l >= 17 && s[11:17] == "trojan" || l >= 22 && s[11:22] == "shadowsocks" {
|
||||
var m proxyman.SenderConfig
|
||||
proto.Unmarshal(outbound.SenderSettings.Value, &m)
|
||||
if m.MultiplexSettings == nil || !m.MultiplexSettings.Enabled {
|
||||
t = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if v && !t {
|
||||
buf.Cone = false
|
||||
}
|
||||
|
||||
server, err := core.New(config)
|
||||
if err != nil {
|
||||
return nil, newError("failed to create server").Base(err)
|
||||
|
Reference in New Issue
Block a user