Skip to content

Commit

Permalink
Clean up measure test config (#80)
Browse files Browse the repository at this point in the history
- only outbound, dispatcher, log module is needed
- core app register order does not matter
  • Loading branch information
yuhan6665 authored Dec 29, 2024
1 parent afe477f commit bba66dc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libv2ray_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (

v2net "github.com/xtls/xray-core/common/net"
v2filesystem "github.com/xtls/xray-core/common/platform/filesystem"
"github.com/xtls/xray-core/common/serial"
v2core "github.com/xtls/xray-core/core"
v2stats "github.com/xtls/xray-core/features/stats"
v2serial "github.com/xtls/xray-core/infra/conf/serial"
Expand Down Expand Up @@ -212,7 +213,13 @@ func MeasureOutboundDelay(ConfigureFileContent string, url string) (int64, error
config.Inbound = nil
// config.App: (fakedns), log, dispatcher, InboundConfig, OutboundConfig, (stats), router, dns, (policy)
// keep only basic features
config.App = config.App[:5]
var essentialApp []*serial.TypedMessage
for _, app := range config.App {
if app.Type == "xray.app.proxyman.OutboundConfig" || app.Type == "xray.app.dispatcher.Config" || app.Type == "xray.app.log.Config" {
essentialApp = append(essentialApp, app)
}
}
config.App = essentialApp

inst, err := v2core.New(config)
if err != nil {
Expand Down

0 comments on commit bba66dc

Please sign in to comment.