@@ -104,7 +104,7 @@ |
||
| 104 | 104 | // Handle the error here, e.g. by logging it |
| 105 | 105 | $attempts++; |
| 106 | 106 | if ($attempts == $max_attempts) { |
| 107 | - // Reached max attempts, so throw an exception to indicate failure |
|
| 107 | + // Reached max attempts, so throw an exception to indicate failure |
|
| 108 | 108 | throw new Exception('Failed to retrieve data after ' . $max_attempts . ' attempts.'); |
| 109 | 109 | } |
| 110 | 110 | sleep(1); // Wait for 1 second before retrying |
@@ -3,10 +3,10 @@ discard block |
||
| 3 | 3 | header("Content-type: application/json;"); |
| 4 | 4 | |
| 5 | 5 | function create_tehran_timestamp_tomorrow() { |
| 6 | - date_default_timezone_set('Asia/Tehran'); |
|
| 7 | - $dateTomorrow = new DateTime('tomorrow'); |
|
| 8 | - $timestampTomorrow = strtotime($dateTomorrow->format('Y-m-d H:i:s')); |
|
| 9 | - return $timestampTomorrow; |
|
| 6 | + date_default_timezone_set('Asia/Tehran'); |
|
| 7 | + $dateTomorrow = new DateTime('tomorrow'); |
|
| 8 | + $timestampTomorrow = strtotime($dateTomorrow->format('Y-m-d H:i:s')); |
|
| 9 | + return $timestampTomorrow; |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | function isEvenLength($str) { |
@@ -22,27 +22,27 @@ discard block |
||
| 22 | 22 | function extract_names($input){ |
| 23 | 23 | foreach($input as $config){ |
| 24 | 24 | if ($config['tag'] !== ""){ |
| 25 | - $locationNames[] = $config['tag']; |
|
| 25 | + $locationNames[] = $config['tag']; |
|
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | return $locationNames; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | function processWsPath($input) { |
| 32 | - if (strpos($input, '/') === 0) { |
|
| 32 | + if (strpos($input, '/') === 0) { |
|
| 33 | 33 | $input = substr($input, 1); |
| 34 | - } |
|
| 35 | - $max_early_data = 0; |
|
| 36 | - if (strpos($input, '?ed=2048') !== false) { |
|
| 34 | + } |
|
| 35 | + $max_early_data = 0; |
|
| 36 | + if (strpos($input, '?ed=2048') !== false) { |
|
| 37 | 37 | $input = str_replace('?ed=2048', '', $input); |
| 38 | 38 | $max_early_data = 2048; |
| 39 | - } |
|
| 40 | - $output = [ |
|
| 41 | - "path" => "/" . $input, |
|
| 42 | - "max_early_data" => $max_early_data |
|
| 43 | - ]; |
|
| 39 | + } |
|
| 40 | + $output = [ |
|
| 41 | + "path" => "/" . $input, |
|
| 42 | + "max_early_data" => $max_early_data |
|
| 43 | + ]; |
|
| 44 | 44 | |
| 45 | - return $output; |
|
| 45 | + return $output; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | function VmessSingbox($VmessUrl) |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | "ping_timeout" => "15s", |
| 107 | 107 | "permit_without_stream" => false, |
| 108 | 108 | ]; |
| 109 | - if ($configResult["transport"]["service_name"] === "" || is_null($configResult["transport"]["service_name"])) return null; |
|
| 109 | + if ($configResult["transport"]["service_name"] === "" || is_null($configResult["transport"]["service_name"])) return null; |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | return $configResult; |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | ], |
| 323 | 323 | ]; |
| 324 | 324 | if (!isset($decodedTuic['params']['alpn']) || is_null($decodedTuic['params']['alpn']) || $decodedTuic['params']['alpn'] === "") { |
| 325 | - unset($configResult['tls']["alpn"]); |
|
| 325 | + unset($configResult['tls']["alpn"]); |
|
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | return $configResult; |