From 66815f4b91c9f6742f528fd632c570018d05a98c Mon Sep 17 00:00:00 2001 From: Alpha Kane Date: Wed, 13 Apr 2022 18:02:03 +0800 Subject: [PATCH] Protocols: Surge: fix surge & surfboard MANAGED-CONFIG URL --- app/Http/Controllers/Client/Protocols/Surfboard.php | 4 +++- app/Http/Controllers/Client/Protocols/Surge.php | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Client/Protocols/Surfboard.php b/app/Http/Controllers/Client/Protocols/Surfboard.php index c78ae0ee..fe216e56 100644 --- a/app/Http/Controllers/Client/Protocols/Surfboard.php +++ b/app/Http/Controllers/Client/Protocols/Surfboard.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Client\Protocols; +use App\Utils\Helper; class Surfboard { @@ -53,7 +54,8 @@ class Surfboard } // Subscription link - $subsURL = config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $user['token']; + $subsHost = Helper::getSubscribeHost(); + $subsURL = "{$subsHost}/api/v1/client/subscribe?token={$user['token']}"; $subsDomain = $_SERVER['SERVER_NAME']; $config = str_replace('$subs_link', $subsURL, $config); diff --git a/app/Http/Controllers/Client/Protocols/Surge.php b/app/Http/Controllers/Client/Protocols/Surge.php index 94938023..21dadd25 100644 --- a/app/Http/Controllers/Client/Protocols/Surge.php +++ b/app/Http/Controllers/Client/Protocols/Surge.php @@ -2,6 +2,8 @@ namespace App\Http\Controllers\Client\Protocols; +use App\Utils\Helper; + class Surge { public $flag = 'surge'; @@ -52,7 +54,8 @@ class Surge } // Subscription link - $subsURL = config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $user['token']; + $subsHost = Helper::getSubscribeHost(); + $subsURL = "{$subsHost}/api/v1/client/subscribe?token={$user['token']}"; $subsDomain = $_SERVER['SERVER_NAME']; $config = str_replace('$subs_link', $subsURL, $config);