From 79cdac52f667058119c25d14cb093f4b9cf74593 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sat, 4 Apr 2026 00:07:46 +0000
Subject: [PATCH] Add highestPing balancer strategy and update Xray-core
download URLs to xAlokyx/Xray-core
Agent-Logs-Url: https://github.com/xAlokyx/3x-ui/sessions/eb6d9a49-be1a-406c-a4a5-a8fea6b1a809
Co-authored-by: xAlokyx <234771438+xAlokyx@users.noreply.github.com>
---
.github/workflows/release.yml | 4 ++--
DockerInit.sh | 2 +-
web/html/modals/xray_balancer_modal.html | 1 +
web/html/settings/xray/balancers.html | 1 +
web/html/xray.html | 6 +++---
web/service/server.go | 4 ++--
6 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index ed9417c9..e7520db8 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -126,7 +126,7 @@ jobs:
cd x-ui/bin
# Download dependencies
- Xray_URL="https://github.com/XTLS/Xray-core/releases/download/v26.2.6/"
+ Xray_URL="https://github.com/xAlokyx/Xray-core/releases/download/v26.2.6/"
if [ "${{ matrix.platform }}" == "amd64" ]; then
wget -q ${Xray_URL}Xray-linux-64.zip
unzip Xray-linux-64.zip
@@ -244,7 +244,7 @@ jobs:
cd x-ui\bin
# Download Xray for Windows
- $Xray_URL = "https://github.com/XTLS/Xray-core/releases/download/v26.2.6/"
+ $Xray_URL = "https://github.com/xAlokyx/Xray-core/releases/download/v26.2.6/"
Invoke-WebRequest -Uri "${Xray_URL}Xray-windows-64.zip" -OutFile "Xray-windows-64.zip"
Expand-Archive -Path "Xray-windows-64.zip" -DestinationPath .
Remove-Item "Xray-windows-64.zip"
diff --git a/DockerInit.sh b/DockerInit.sh
index a8e87a9e..c48ab260 100755
--- a/DockerInit.sh
+++ b/DockerInit.sh
@@ -27,7 +27,7 @@ case $1 in
esac
mkdir -p build/bin
cd build/bin
-curl -sfLRO "https://github.com/XTLS/Xray-core/releases/download/v26.2.6/Xray-linux-${ARCH}.zip"
+curl -sfLRO "https://github.com/xAlokyx/Xray-core/releases/download/v26.2.6/Xray-linux-${ARCH}.zip"
unzip "Xray-linux-${ARCH}.zip"
rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat
mv xray "xray-linux-${FNAME}"
diff --git a/web/html/modals/xray_balancer_modal.html b/web/html/modals/xray_balancer_modal.html
index fea4019a..536a30b4 100644
--- a/web/html/modals/xray_balancer_modal.html
+++ b/web/html/modals/xray_balancer_modal.html
@@ -23,6 +23,7 @@
Round Robin
Least Load
Least Ping
+ Highest Ping
Round Robin
Least Load
Least Ping
+ Highest Ping
[[ sel ]]
diff --git a/web/html/xray.html b/web/html/xray.html
index ebe31f48..8138a508 100644
--- a/web/html/xray.html
+++ b/web/html/xray.html
@@ -890,17 +890,17 @@
},
updateObservatorySelectors() {
newTemplateSettings = this.templateSettings;
- const leastPings = this.balancersData.filter((b) => b.strategy == 'leastPing');
+ const pingBasedBalancers = this.balancersData.filter((b) => b.strategy == 'leastPing' || b.strategy == 'highestPing');
const leastLoads = this.balancersData.filter((b) =>
b.strategy === 'leastLoad' ||
b.strategy === 'roundRobin' ||
b.strategy === 'random'
);
- if (leastPings.length > 0) {
+ if (pingBasedBalancers.length > 0) {
if (!newTemplateSettings.observatory)
newTemplateSettings.observatory = this.defaultObservatory;
newTemplateSettings.observatory.subjectSelector = [];
- leastPings.forEach((b) => {
+ pingBasedBalancers.forEach((b) => {
b.selector.forEach((s) => {
if (!newTemplateSettings.observatory.subjectSelector.includes(s))
newTemplateSettings.observatory.subjectSelector.push(s);
diff --git a/web/service/server.go b/web/service/server.go
index 2e0b34b8..1a3590ed 100644
--- a/web/service/server.go
+++ b/web/service/server.go
@@ -519,7 +519,7 @@ func (s *ServerService) sampleCPUUtilization() (float64, error) {
func (s *ServerService) GetXrayVersions() ([]string, error) {
const (
- XrayURL = "https://api.github.com/repos/XTLS/Xray-core/releases"
+ XrayURL = "https://api.github.com/repos/xAlokyx/Xray-core/releases"
bufferSize = 8192
)
@@ -621,7 +621,7 @@ func (s *ServerService) downloadXRay(version string) (string, error) {
}
fileName := fmt.Sprintf("Xray-%s-%s.zip", osName, arch)
- url := fmt.Sprintf("https://github.com/XTLS/Xray-core/releases/download/%s/%s", version, fileName)
+ url := fmt.Sprintf("https://github.com/xAlokyx/Xray-core/releases/download/%s/%s", version, fileName)
resp, err := http.Get(url)
if err != nil {
return "", err