mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-23 11:27:30 +08:00
refactor: refactor subscription delivery logic, change payment return_url to origin_url concatenation
- Unify protocol filter configuration to client.type.field (dot-path, three-segment) format, support strict whitelist mode - Refactor AbstractProtocol and all protocol classes for more flexible and maintainable subscription delivery - Change payment callback logic: use origin_url concatenation instead of return_url for more accurate redirects
This commit is contained in:
+13
-11
@@ -3,19 +3,21 @@
|
||||
namespace App\Protocols;
|
||||
|
||||
use App\Support\AbstractProtocol;
|
||||
use App\Models\Server;
|
||||
|
||||
class Loon extends AbstractProtocol
|
||||
{
|
||||
public $flags = ['loon'];
|
||||
|
||||
public $allowedProtocols = [
|
||||
Server::TYPE_SHADOWSOCKS,
|
||||
Server::TYPE_VMESS,
|
||||
Server::TYPE_TROJAN,
|
||||
Server::TYPE_HYSTERIA,
|
||||
];
|
||||
|
||||
protected $protocolRequirements = [
|
||||
'loon' => [
|
||||
'hysteria' => [
|
||||
'protocol_settings.version' => [
|
||||
'2' => '637'
|
||||
],
|
||||
],
|
||||
],
|
||||
'loon.hysteria.protocol_settings.version' => [2 => '637'],
|
||||
];
|
||||
|
||||
public function handle()
|
||||
@@ -27,17 +29,17 @@ class Loon extends AbstractProtocol
|
||||
|
||||
foreach ($servers as $item) {
|
||||
if (
|
||||
$item['type'] === 'shadowsocks'
|
||||
$item['type'] === Server::TYPE_SHADOWSOCKS
|
||||
) {
|
||||
$uri .= self::buildShadowsocks($item['password'], $item);
|
||||
}
|
||||
if ($item['type'] === 'vmess') {
|
||||
if ($item['type'] === Server::TYPE_VMESS) {
|
||||
$uri .= self::buildVmess($item['password'], $item);
|
||||
}
|
||||
if ($item['type'] === 'trojan') {
|
||||
if ($item['type'] === Server::TYPE_TROJAN) {
|
||||
$uri .= self::buildTrojan($item['password'], $item);
|
||||
}
|
||||
if ($item['type'] === 'hysteria') {
|
||||
if ($item['type'] === Server::TYPE_HYSTERIA) {
|
||||
$uri .= self::buildHysteria($item['password'], $item, $user);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user