🐛 fix: Rename 'hysteria2' to 'hysteria' across protocol definitions and schemas for consistency
This commit is contained in:
@@ -3,7 +3,7 @@ export const protocols = [
|
||||
'vmess',
|
||||
'vless',
|
||||
'trojan',
|
||||
'hysteria2',
|
||||
'hysteria',
|
||||
'tuic',
|
||||
'anytls',
|
||||
'socks',
|
||||
@@ -64,7 +64,7 @@ export const SECURITY = {
|
||||
vmess: ['none', 'tls'] as const,
|
||||
vless: ['none', 'tls', 'reality'] as const,
|
||||
trojan: ['tls'] as const,
|
||||
hysteria2: ['tls'] as const,
|
||||
hysteria: ['tls'] as const,
|
||||
tuic: ['tls'] as const,
|
||||
anytls: ['tls'] as const,
|
||||
naive: ['none', 'tls'] as const,
|
||||
|
||||
@@ -90,9 +90,9 @@ export function getProtocolDefaultConfig(proto: ProtocolType) {
|
||||
cert_dns_env: null,
|
||||
ratio: 1,
|
||||
} as any;
|
||||
case 'hysteria2':
|
||||
case 'hysteria':
|
||||
return {
|
||||
type: 'hysteria2',
|
||||
type: 'hysteria',
|
||||
enable: false,
|
||||
port: null,
|
||||
hop_ports: null,
|
||||
|
||||
@@ -603,7 +603,7 @@ export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
||||
condition: (p) => p.security === 'tls' && p.cert_mode === 'dns',
|
||||
},
|
||||
],
|
||||
hysteria2: [
|
||||
hysteria: [
|
||||
{
|
||||
name: 'ratio',
|
||||
type: 'number',
|
||||
|
||||
@@ -104,16 +104,16 @@ const trojan = z.object({
|
||||
cert_dns_env: nullableString,
|
||||
});
|
||||
|
||||
const hysteria2 = z.object({
|
||||
const hysteria = z.object({
|
||||
ratio: nullableRatio,
|
||||
type: z.literal('hysteria2'),
|
||||
type: z.literal('hysteria'),
|
||||
enable: nullableBool,
|
||||
hop_ports: nullableString,
|
||||
hop_interval: z.number().nullish(),
|
||||
obfs_password: nullableString,
|
||||
obfs: z.enum(['none', 'salamander'] as const).nullish(),
|
||||
port: nullablePort,
|
||||
security: z.enum(SECURITY.hysteria2).nullish(),
|
||||
security: z.enum(SECURITY.hysteria).nullish(),
|
||||
sni: nullableString,
|
||||
allow_insecure: nullableBool,
|
||||
fingerprint: nullableString,
|
||||
@@ -207,7 +207,7 @@ export const protocolApiScheme = z.discriminatedUnion('type', [
|
||||
vmess,
|
||||
vless,
|
||||
trojan,
|
||||
hysteria2,
|
||||
hysteria,
|
||||
tuic,
|
||||
anytls,
|
||||
socks,
|
||||
|
||||
Reference in New Issue
Block a user