mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-24 03:57:27 +08:00
fix: improve node filtering by client base_version, set subscription content-type, and add hop_interval support for hysteria2
- Refactor node filtering logic to correctly handle client base_version requirements. - Set appropriate Content-Type header for subscription responses. - Add support for hop_interval configuration in hysteria2 node delivery.
This commit is contained in:
@@ -16,6 +16,9 @@ class Shadowrocket extends AbstractProtocol
|
||||
'2' => '1993'
|
||||
],
|
||||
],
|
||||
'anytls' => [
|
||||
'base_version' => '2592'
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
@@ -54,7 +57,8 @@ class Shadowrocket extends AbstractProtocol
|
||||
$uri .= self::buildAnyTLS($user['uuid'], $item);
|
||||
}
|
||||
}
|
||||
return base64_encode($uri);
|
||||
return response(base64_encode($uri))
|
||||
->header('content-type', 'text/plain');
|
||||
}
|
||||
|
||||
|
||||
@@ -267,8 +271,12 @@ class Shadowrocket extends AbstractProtocol
|
||||
$params['obfs-password'] = data_get($protocol_settings, 'obfs.password');
|
||||
}
|
||||
$params['insecure'] = data_get($protocol_settings, 'tls.allow_insecure');
|
||||
if (isset($server['ports']))
|
||||
if (isset($protocol_settings['hop_interval'])) {
|
||||
$params['keepalive'] = $protocol_settings['hop_interval'];
|
||||
}
|
||||
if (isset($server['ports'])) {
|
||||
$params['mport'] = $server['ports'];
|
||||
}
|
||||
$query = http_build_query($params);
|
||||
$addr = Helper::wrapIPv6($server['host']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user