@swimmingliu/autovpn 1.6.4 → 1.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,27 @@
1
+ const SUBSCRIPTION_PAYLOAD = `__MAIN_DATA__`;
2
+
3
+ function buildRandomPayload() {
4
+ const randomBytes = new Uint8Array(Math.floor(Math.random() * 100));
5
+ crypto.getRandomValues(randomBytes);
6
+ return String.fromCharCode.apply(null, randomBytes);
7
+ }
8
+
9
+ async function handleSubscriptionRequest(request) {
10
+ try {
11
+ const url = new URL(request.url);
12
+ const secretToken = url.searchParams.get("serect_key");
13
+ const responsePayload = secretToken === "swimmingliu"
14
+ ? SUBSCRIPTION_PAYLOAD
15
+ : buildRandomPayload();
16
+ return new Response(btoa(responsePayload));
17
+ } catch (error) {
18
+ console.log(error);
19
+ return new Response(error.toString());
20
+ }
21
+ }
22
+
23
+ export default {
24
+ async fetch(request) {
25
+ return handleSubscriptionRequest(request);
26
+ },
27
+ };
@@ -5,7 +5,7 @@ const ZH_MESSAGES = {
5
5
  locale: 'zh-CN',
6
6
  appTitle: 'AutoVPN',
7
7
  sidebarTitle: 'AutoVPN',
8
- sidebarVersion: 'v.1.6.4',
8
+ sidebarVersion: 'v.1.6.6',
9
9
  brandSubtitle: '概览、运行、结果、订阅、日志、设置统一管理',
10
10
  languageLabel: '',
11
11
  saveButton: '保存配置',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swimmingliu/autovpn",
3
- "version": "1.6.4",
3
+ "version": "1.6.6",
4
4
  "description": "npm wrapper for the AutoVPN headless CLI",
5
5
  "type": "module",
6
6
  "repository": {