diff --git a/apps/admin/app/dashboard/servers/form-schema.ts b/apps/admin/app/dashboard/servers/form-schema.ts index d70435e..7169e82 100644 --- a/apps/admin/app/dashboard/servers/form-schema.ts +++ b/apps/admin/app/dashboard/servers/form-schema.ts @@ -60,8 +60,8 @@ export const LABELS = { 'middle': 'Middle', 'high': 'High', // ss plugins - 'obfs': 'Simple Obfs', 'v2ray-plugin': 'V2Ray Plugin', + 'simple-obfs': 'Simple Obfs', } as const; // Flat arrays for enum-like sets @@ -75,7 +75,7 @@ export const SS_CIPHERS = [ '2022-blake3-chacha20-poly1305', ] as const; -export const SS_PLUGINS = ['none', 'obfs', 'v2ray-plugin'] as const; +export const SS_PLUGINS = ['none', 'simple-obfs', 'v2ray-plugin'] as const; export const TRANSPORTS = { vmess: ['tcp', 'websocket', 'grpc'] as const, @@ -130,7 +130,7 @@ const ss = z.object({ cipher: z.enum(SS_CIPHERS as any).nullish(), server_key: nullableString, plugin: z.enum(SS_PLUGINS as any).nullish(), - plugin_opts: nullableString, + plugin_options: nullableString, }); const vmess = z.object({ @@ -399,7 +399,7 @@ export const PROTOCOL_FIELDS: Record = { label: 'plugin_opts', placeholder: (t: (key: string) => string, p: any) => { switch (p.plugin) { - case 'obfs': + case 'simple-obfs': return 'obfs=http;obfs-host=www.bing.com;path=/'; case 'v2ray-plugin': return 'WebSocket: mode=websocket;host=mydomain.me;path=/;tls=true\n\nQUIC: mode=quic;host=mydomain.me'; @@ -408,7 +408,7 @@ export const PROTOCOL_FIELDS: Record = { } }, group: 'plugin', - condition: (p) => ['obfs', 'v2ray-plugin'].includes(p.plugin), + condition: (p) => ['simple-obfs', 'v2ray-plugin'].includes(p.plugin), }, ], vmess: [ diff --git a/apps/admin/services/admin/index.ts b/apps/admin/services/admin/index.ts index 4ebecd4..bdf189b 100644 --- a/apps/admin/services/admin/index.ts +++ b/apps/admin/services/admin/index.ts @@ -1,5 +1,5 @@ // @ts-ignore - + // API 更新时间: // API 唯一标识: import * as ads from './ads'; diff --git a/apps/admin/services/admin/typings.d.ts b/apps/admin/services/admin/typings.d.ts index a7ff466..8a04a81 100644 --- a/apps/admin/services/admin/typings.d.ts +++ b/apps/admin/services/admin/typings.d.ts @@ -1519,6 +1519,18 @@ declare namespace API { reduce_rtt?: boolean; udp_relay_mode?: string; congestion_controller?: string; + /** obfs, v2ray-plugin, simple-obfs */ + plugin?: string; + /** plugin options, eg: obfs=http;obfs-host=www.bing.com */ + plugin_options?: string; + /** mux, eg: off/low/medium/high */ + multiplex?: string; + /** padding scheme */ + padding_scheme?: string; + /** upload speed limit */ + up_mbps?: number; + /** download speed limit */ + down_mbps?: number; }; type PubilcRegisterConfig = { diff --git a/apps/admin/services/common/index.ts b/apps/admin/services/common/index.ts index 73b3bda..61ba129 100644 --- a/apps/admin/services/common/index.ts +++ b/apps/admin/services/common/index.ts @@ -1,5 +1,5 @@ // @ts-ignore - + // API 更新时间: // API 唯一标识: import * as auth from './auth'; diff --git a/apps/admin/services/common/typings.d.ts b/apps/admin/services/common/typings.d.ts index 3771430..93bc507 100644 --- a/apps/admin/services/common/typings.d.ts +++ b/apps/admin/services/common/typings.d.ts @@ -501,6 +501,46 @@ declare namespace API { privacy_policy: string; }; + type Protocol = { + type: string; + port: number; + security?: string; + sni?: string; + allow_insecure?: boolean; + fingerprint?: string; + reality_server_addr?: string; + reality_server_port?: number; + reality_private_key?: string; + reality_public_key?: string; + reality_short_id?: string; + transport?: string; + host?: string; + path?: string; + service_name?: string; + cipher?: string; + server_key?: string; + flow?: string; + hop_ports?: string; + hop_interval?: number; + obfs_password?: string; + disable_sni?: boolean; + reduce_rtt?: boolean; + udp_relay_mode?: string; + congestion_controller?: string; + /** obfs, v2ray-plugin, simple-obfs */ + plugin?: string; + /** plugin options, eg: obfs=http;obfs-host=www.bing.com */ + plugin_options?: string; + /** mux, eg: off/low/medium/high */ + multiplex?: string; + /** padding scheme */ + padding_scheme?: string; + /** upload speed limit */ + up_mbps?: number; + /** download speed limit */ + down_mbps?: number; + }; + type PubilcRegisterConfig = { stop_register: boolean; enable_ip_register_limit: boolean; diff --git a/apps/user/services/common/index.ts b/apps/user/services/common/index.ts index 73b3bda..61ba129 100644 --- a/apps/user/services/common/index.ts +++ b/apps/user/services/common/index.ts @@ -1,5 +1,5 @@ // @ts-ignore - + // API 更新时间: // API 唯一标识: import * as auth from './auth'; diff --git a/apps/user/services/common/typings.d.ts b/apps/user/services/common/typings.d.ts index 3771430..93bc507 100644 --- a/apps/user/services/common/typings.d.ts +++ b/apps/user/services/common/typings.d.ts @@ -501,6 +501,46 @@ declare namespace API { privacy_policy: string; }; + type Protocol = { + type: string; + port: number; + security?: string; + sni?: string; + allow_insecure?: boolean; + fingerprint?: string; + reality_server_addr?: string; + reality_server_port?: number; + reality_private_key?: string; + reality_public_key?: string; + reality_short_id?: string; + transport?: string; + host?: string; + path?: string; + service_name?: string; + cipher?: string; + server_key?: string; + flow?: string; + hop_ports?: string; + hop_interval?: number; + obfs_password?: string; + disable_sni?: boolean; + reduce_rtt?: boolean; + udp_relay_mode?: string; + congestion_controller?: string; + /** obfs, v2ray-plugin, simple-obfs */ + plugin?: string; + /** plugin options, eg: obfs=http;obfs-host=www.bing.com */ + plugin_options?: string; + /** mux, eg: off/low/medium/high */ + multiplex?: string; + /** padding scheme */ + padding_scheme?: string; + /** upload speed limit */ + up_mbps?: number; + /** download speed limit */ + down_mbps?: number; + }; + type PubilcRegisterConfig = { stop_register: boolean; enable_ip_register_limit: boolean; diff --git a/apps/user/services/user/index.ts b/apps/user/services/user/index.ts index f988131..12fe8d0 100644 --- a/apps/user/services/user/index.ts +++ b/apps/user/services/user/index.ts @@ -1,5 +1,5 @@ // @ts-ignore - + // API 更新时间: // API 唯一标识: import * as announcement from './announcement'; diff --git a/apps/user/services/user/typings.d.ts b/apps/user/services/user/typings.d.ts index bde9cb3..825904d 100644 --- a/apps/user/services/user/typings.d.ts +++ b/apps/user/services/user/typings.d.ts @@ -540,6 +540,46 @@ declare namespace API { privacy_policy: string; }; + type Protocol = { + type: string; + port: number; + security?: string; + sni?: string; + allow_insecure?: boolean; + fingerprint?: string; + reality_server_addr?: string; + reality_server_port?: number; + reality_private_key?: string; + reality_public_key?: string; + reality_short_id?: string; + transport?: string; + host?: string; + path?: string; + service_name?: string; + cipher?: string; + server_key?: string; + flow?: string; + hop_ports?: string; + hop_interval?: number; + obfs_password?: string; + disable_sni?: boolean; + reduce_rtt?: boolean; + udp_relay_mode?: string; + congestion_controller?: string; + /** obfs, v2ray-plugin, simple-obfs */ + plugin?: string; + /** plugin options, eg: obfs=http;obfs-host=www.bing.com */ + plugin_options?: string; + /** mux, eg: off/low/medium/high */ + multiplex?: string; + /** padding scheme */ + padding_scheme?: string; + /** upload speed limit */ + up_mbps?: number; + /** download speed limit */ + down_mbps?: number; + }; + type PubilcRegisterConfig = { stop_register: boolean; enable_ip_register_limit: boolean;