1069 lines
26 KiB
TypeScript
1069 lines
26 KiB
TypeScript
import {
|
|
generateMLKEM768KeyPair,
|
|
generatePassword,
|
|
generateRealityKeyPair,
|
|
generateRealityShortId,
|
|
} from '../generate';
|
|
import {
|
|
CERT_MODES,
|
|
ENCRYPTION_MODES,
|
|
ENCRYPTION_RTT,
|
|
ENCRYPTION_TYPES,
|
|
FINGERPRINTS,
|
|
FLOWS,
|
|
multiplexLevels,
|
|
SECURITY,
|
|
SS_CIPHERS,
|
|
TRANSPORTS,
|
|
TUIC_CONGESTION,
|
|
TUIC_UDP_RELAY_MODES,
|
|
XHTTP_MODES,
|
|
} from './constants';
|
|
import type { FieldConfig } from './types';
|
|
|
|
export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
|
shadowsocks: [
|
|
{
|
|
name: 'ratio',
|
|
type: 'number',
|
|
label: 'traffic_ratio',
|
|
min: 0,
|
|
step: 0.01,
|
|
defaultValue: 1,
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'port',
|
|
type: 'number',
|
|
label: 'port',
|
|
min: 1,
|
|
max: 65535,
|
|
placeholder: '1-65535',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'cipher',
|
|
type: 'select',
|
|
label: 'cipher',
|
|
options: SS_CIPHERS,
|
|
defaultValue: 'chacha20-ietf-poly1305',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'server_key',
|
|
type: 'input',
|
|
label: 'server_key',
|
|
generate: {
|
|
function: () => generatePassword(32),
|
|
},
|
|
group: 'basic',
|
|
condition: (p) =>
|
|
[
|
|
'2022-blake3-aes-128-gcm',
|
|
'2022-blake3-aes-256-gcm',
|
|
'2022-blake3-chacha20-poly1305',
|
|
].includes(p.cipher),
|
|
},
|
|
{
|
|
name: 'obfs',
|
|
type: 'select',
|
|
label: 'obfs',
|
|
options: ['none', 'http', 'tls'],
|
|
defaultValue: 'none',
|
|
group: 'obfs',
|
|
},
|
|
{
|
|
name: 'obfs_host',
|
|
type: 'input',
|
|
label: 'host',
|
|
placeholder: 'e.g. www.bing.com',
|
|
group: 'obfs',
|
|
condition: (p) => p.obfs && p.obfs !== 'none',
|
|
},
|
|
{
|
|
name: 'obfs_path',
|
|
type: 'input',
|
|
label: 'path',
|
|
placeholder: 'e.g. /path/to/obfs',
|
|
group: 'obfs',
|
|
condition: (p) => p.obfs && p.obfs !== 'none',
|
|
},
|
|
{
|
|
name: 'sni',
|
|
type: 'input',
|
|
label: 'security_sni',
|
|
group: 'security',
|
|
condition: (p) => p.obfs === 'tls',
|
|
},
|
|
{
|
|
name: 'allow_insecure',
|
|
type: 'switch',
|
|
label: 'security_allow_insecure',
|
|
group: 'security',
|
|
condition: (p) => p.obfs === 'tls',
|
|
},
|
|
{
|
|
name: 'cert_mode',
|
|
type: 'select',
|
|
label: 'cert_mode',
|
|
options: CERT_MODES,
|
|
defaultValue: 'none',
|
|
group: 'security',
|
|
condition: (p) => p.obfs === 'tls',
|
|
},
|
|
{
|
|
name: 'cert_dns_provider',
|
|
type: 'input',
|
|
label: 'cert_dns_provider',
|
|
placeholder: 'e.g. cloudflare, aliyun',
|
|
group: 'security',
|
|
condition: (p) => p.obfs === 'tls' && p.cert_mode === 'dns',
|
|
},
|
|
{
|
|
name: 'cert_dns_env',
|
|
type: 'textarea',
|
|
label: 'cert_dns_env',
|
|
placeholder:
|
|
'CF_DNS_API_TOKEN=1234567890abcdefghijklmnopqrstuvwxyz\nALI_ACCESS_KEY_ID=your_access_key_id\nALI_ACCESS_KEY_SECRET=your_access_key_secret',
|
|
group: 'security',
|
|
condition: (p) => p.obfs === 'tls' && p.cert_mode === 'dns',
|
|
},
|
|
],
|
|
vmess: [
|
|
{
|
|
name: 'ratio',
|
|
type: 'number',
|
|
label: 'traffic_ratio',
|
|
min: 0,
|
|
step: 0.01,
|
|
defaultValue: 1,
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'port',
|
|
type: 'number',
|
|
label: 'port',
|
|
min: 1,
|
|
max: 65535,
|
|
placeholder: '1-65535',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'transport',
|
|
type: 'select',
|
|
label: 'transport',
|
|
options: TRANSPORTS.vmess,
|
|
defaultValue: 'tcp',
|
|
group: 'transport',
|
|
},
|
|
{
|
|
name: 'security',
|
|
type: 'select',
|
|
label: 'security',
|
|
options: SECURITY.vmess,
|
|
defaultValue: 'none',
|
|
group: 'security',
|
|
},
|
|
{
|
|
name: 'host',
|
|
type: 'input',
|
|
label: 'host',
|
|
placeholder: 'e.g. www.bing.com',
|
|
group: 'transport',
|
|
condition: (p) => ['websocket', 'xhttp', 'httpupgrade'].includes(p.transport),
|
|
},
|
|
{
|
|
name: 'path',
|
|
type: 'input',
|
|
label: 'path',
|
|
placeholder: 'e.g. /path/to/obfs',
|
|
group: 'transport',
|
|
condition: (p) => ['websocket', 'xhttp', 'httpupgrade'].includes(p.transport),
|
|
},
|
|
{
|
|
name: 'service_name',
|
|
type: 'input',
|
|
label: 'service_name',
|
|
group: 'transport',
|
|
condition: (p) => p.transport === 'grpc',
|
|
},
|
|
{
|
|
name: 'sni',
|
|
type: 'input',
|
|
label: 'security_sni',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'allow_insecure',
|
|
type: 'switch',
|
|
label: 'security_allow_insecure',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'fingerprint',
|
|
type: 'select',
|
|
label: 'security_fingerprint',
|
|
options: FINGERPRINTS,
|
|
defaultValue: 'chrome',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'cert_mode',
|
|
type: 'select',
|
|
label: 'cert_mode',
|
|
options: CERT_MODES,
|
|
defaultValue: 'none',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls',
|
|
},
|
|
{
|
|
name: 'cert_dns_provider',
|
|
type: 'input',
|
|
label: 'cert_dns_provider',
|
|
placeholder: 'e.g. cloudflare, aliyun',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls' && p.cert_mode === 'dns',
|
|
},
|
|
{
|
|
name: 'cert_dns_env',
|
|
type: 'textarea',
|
|
label: 'cert_dns_env',
|
|
placeholder:
|
|
'CF_DNS_API_TOKEN=1234567890abcdefghijklmnopqrstuvwxyz\nALI_ACCESS_KEY_ID=your_access_key_id\nALI_ACCESS_KEY_SECRET=your_access_key_secret',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls' && p.cert_mode === 'dns',
|
|
},
|
|
],
|
|
vless: [
|
|
{
|
|
name: 'ratio',
|
|
type: 'number',
|
|
label: 'traffic_ratio',
|
|
min: 0,
|
|
step: 0.01,
|
|
defaultValue: 1,
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'port',
|
|
type: 'number',
|
|
label: 'port',
|
|
min: 1,
|
|
max: 65535,
|
|
placeholder: '1-65535',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'transport',
|
|
type: 'select',
|
|
label: 'transport',
|
|
options: TRANSPORTS.vless,
|
|
defaultValue: 'tcp',
|
|
group: 'transport',
|
|
},
|
|
{
|
|
name: 'flow',
|
|
type: 'select',
|
|
label: 'flow',
|
|
options: FLOWS.vless,
|
|
defaultValue: 'none',
|
|
group: 'transport',
|
|
condition: (p) => p.transport === 'tcp',
|
|
},
|
|
{
|
|
name: 'security',
|
|
type: 'select',
|
|
label: 'security',
|
|
options: SECURITY.vless,
|
|
defaultValue: 'none',
|
|
group: 'security',
|
|
},
|
|
{
|
|
name: 'host',
|
|
type: 'input',
|
|
label: 'host',
|
|
placeholder: 'e.g. www.bing.com',
|
|
group: 'transport',
|
|
condition: (p) => ['websocket', 'mkcp', 'httpupgrade', 'xhttp'].includes(p.transport),
|
|
},
|
|
{
|
|
name: 'path',
|
|
type: 'input',
|
|
label: 'path',
|
|
placeholder: 'e.g. /path/to/obfs',
|
|
group: 'transport',
|
|
condition: (p) => ['websocket', 'mkcp', 'httpupgrade', 'xhttp'].includes(p.transport),
|
|
},
|
|
{
|
|
name: 'service_name',
|
|
type: 'input',
|
|
label: 'service_name',
|
|
group: 'transport',
|
|
condition: (p) => p.transport === 'grpc',
|
|
},
|
|
{
|
|
name: 'xhttp_mode',
|
|
type: 'select',
|
|
label: 'mode',
|
|
options: XHTTP_MODES,
|
|
defaultValue: 'auto',
|
|
group: 'transport',
|
|
condition: (p) => p.transport === 'xhttp',
|
|
},
|
|
{
|
|
name: 'xhttp_extra',
|
|
type: 'textarea',
|
|
label: 'extra',
|
|
placeholder: '{}',
|
|
group: 'transport',
|
|
condition: (p) => p.transport === 'xhttp',
|
|
},
|
|
{
|
|
name: 'sni',
|
|
type: 'input',
|
|
label: 'security_sni',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'allow_insecure',
|
|
type: 'switch',
|
|
label: 'security_allow_insecure',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'fingerprint',
|
|
type: 'select',
|
|
label: 'security_fingerprint',
|
|
options: FINGERPRINTS,
|
|
defaultValue: 'chrome',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'reality_server_addr',
|
|
type: 'input',
|
|
label: 'security_server_address',
|
|
placeholder: (t) => t('security_server_address_placeholder'),
|
|
group: 'reality',
|
|
condition: (p) => p.security === 'reality',
|
|
},
|
|
{
|
|
name: 'reality_server_port',
|
|
type: 'number',
|
|
label: 'security_server_port',
|
|
min: 1,
|
|
max: 65535,
|
|
placeholder: '1-65535',
|
|
group: 'reality',
|
|
condition: (p) => p.security === 'reality',
|
|
},
|
|
{
|
|
name: 'reality_private_key',
|
|
type: 'input',
|
|
label: 'security_private_key',
|
|
placeholder: (t) => t('security_private_key_placeholder'),
|
|
group: 'reality',
|
|
generate: {
|
|
function: generateRealityKeyPair,
|
|
updateFields: {
|
|
reality_private_key: 'privateKey',
|
|
reality_public_key: 'publicKey',
|
|
},
|
|
},
|
|
condition: (p) => p.security === 'reality',
|
|
},
|
|
{
|
|
name: 'reality_public_key',
|
|
type: 'input',
|
|
label: 'security_public_key',
|
|
placeholder: (t) => t('security_public_key_placeholder'),
|
|
group: 'reality',
|
|
condition: (p) => p.security === 'reality',
|
|
},
|
|
{
|
|
name: 'reality_short_id',
|
|
type: 'input',
|
|
label: 'security_short_id',
|
|
group: 'reality',
|
|
generate: {
|
|
function: generateRealityShortId,
|
|
},
|
|
condition: (p) => p.security === 'reality',
|
|
},
|
|
{
|
|
name: 'encryption',
|
|
type: 'select',
|
|
label: 'encryption',
|
|
options: ENCRYPTION_TYPES,
|
|
defaultValue: 'none',
|
|
group: 'encryption',
|
|
},
|
|
{
|
|
name: 'encryption_mode',
|
|
type: 'select',
|
|
label: 'encryption_mode',
|
|
options: ENCRYPTION_MODES,
|
|
defaultValue: 'native',
|
|
group: 'encryption',
|
|
condition: (p) => p.encryption === 'mlkem768x25519plus',
|
|
},
|
|
{
|
|
name: 'encryption_rtt',
|
|
type: 'select',
|
|
label: 'encryption_rtt',
|
|
options: ENCRYPTION_RTT,
|
|
defaultValue: '1rtt',
|
|
group: 'encryption',
|
|
condition: (p) => p.encryption === 'mlkem768x25519plus',
|
|
},
|
|
{
|
|
name: 'encryption_ticket',
|
|
type: 'input',
|
|
label: 'encryption_ticket',
|
|
placeholder: 'e.g. 600s',
|
|
group: 'encryption',
|
|
condition: (p) => p.encryption === 'mlkem768x25519plus' && p.encryption_rtt === '0rtt',
|
|
},
|
|
{
|
|
name: 'encryption_server_padding',
|
|
type: 'input',
|
|
label: 'encryption_server_padding',
|
|
placeholder: 'e.g. 100-111-1111.75-0-111.50-0-3333',
|
|
group: 'encryption',
|
|
condition: (p) => p.encryption === 'mlkem768x25519plus',
|
|
},
|
|
{
|
|
name: 'encryption_private_key',
|
|
type: 'input',
|
|
label: 'encryption_private_key',
|
|
placeholder: (t) => t('encryption_private_key_placeholder'),
|
|
group: 'encryption',
|
|
generate: {
|
|
functions: [
|
|
{
|
|
label: (t) => t('generate_standard_encryption_key'),
|
|
function: generateRealityKeyPair,
|
|
},
|
|
{
|
|
label: (t) => t('generate_quantum_resistant_key'),
|
|
function: generateMLKEM768KeyPair,
|
|
},
|
|
],
|
|
updateFields: {
|
|
encryption_private_key: 'privateKey',
|
|
encryption_password: 'publicKey',
|
|
},
|
|
},
|
|
condition: (p) => p.encryption === 'mlkem768x25519plus',
|
|
},
|
|
{
|
|
name: 'encryption_client_padding',
|
|
type: 'input',
|
|
label: 'encryption_client_padding',
|
|
placeholder: 'e.g. 100-111-1111.75-0-111.50-0-3333',
|
|
group: 'encryption',
|
|
condition: (p) => p.encryption === 'mlkem768x25519plus',
|
|
},
|
|
{
|
|
name: 'encryption_password',
|
|
type: 'input',
|
|
label: 'encryption_password',
|
|
placeholder: (t) => t('encryption_password_placeholder'),
|
|
group: 'encryption',
|
|
condition: (p) => p.encryption === 'mlkem768x25519plus',
|
|
},
|
|
{
|
|
name: 'cert_mode',
|
|
type: 'select',
|
|
label: 'cert_mode',
|
|
options: CERT_MODES,
|
|
defaultValue: 'none',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls',
|
|
},
|
|
{
|
|
name: 'cert_dns_provider',
|
|
type: 'input',
|
|
label: 'cert_dns_provider',
|
|
placeholder: 'e.g. cloudflare, aliyun',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls' && p.cert_mode === 'dns',
|
|
},
|
|
{
|
|
name: 'cert_dns_env',
|
|
type: 'textarea',
|
|
label: 'cert_dns_env',
|
|
placeholder:
|
|
'CF_DNS_API_TOKEN=1234567890abcdefghijklmnopqrstuvwxyz\nALI_ACCESS_KEY_ID=your_access_key_id\nALI_ACCESS_KEY_SECRET=your_access_key_secret',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls' && p.cert_mode === 'dns',
|
|
},
|
|
],
|
|
trojan: [
|
|
{
|
|
name: 'ratio',
|
|
type: 'number',
|
|
label: 'traffic_ratio',
|
|
min: 0,
|
|
step: 0.01,
|
|
defaultValue: 1,
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'port',
|
|
type: 'number',
|
|
label: 'port',
|
|
min: 1,
|
|
max: 65535,
|
|
placeholder: '1-65535',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'transport',
|
|
type: 'select',
|
|
label: 'transport',
|
|
options: TRANSPORTS.trojan,
|
|
defaultValue: 'tcp',
|
|
group: 'transport',
|
|
},
|
|
{
|
|
name: 'security',
|
|
type: 'select',
|
|
label: 'security',
|
|
options: SECURITY.trojan,
|
|
defaultValue: 'tls',
|
|
group: 'security',
|
|
},
|
|
{
|
|
name: 'host',
|
|
type: 'input',
|
|
label: 'host',
|
|
placeholder: 'e.g. www.bing.com',
|
|
group: 'transport',
|
|
condition: (p) => ['websocket', 'xhttp', 'httpupgrade'].includes(p.transport),
|
|
},
|
|
{
|
|
name: 'path',
|
|
type: 'input',
|
|
label: 'path',
|
|
placeholder: 'e.g. /path/to/obfs',
|
|
group: 'transport',
|
|
condition: (p) => ['websocket', 'xhttp', 'httpupgrade'].includes(p.transport),
|
|
},
|
|
{
|
|
name: 'service_name',
|
|
type: 'input',
|
|
label: 'service_name',
|
|
group: 'transport',
|
|
condition: (p) => p.transport === 'grpc',
|
|
},
|
|
{
|
|
name: 'sni',
|
|
type: 'input',
|
|
label: 'security_sni',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'allow_insecure',
|
|
type: 'switch',
|
|
label: 'security_allow_insecure',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'fingerprint',
|
|
type: 'select',
|
|
label: 'security_fingerprint',
|
|
options: FINGERPRINTS,
|
|
defaultValue: 'chrome',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'cert_mode',
|
|
type: 'select',
|
|
label: 'cert_mode',
|
|
options: CERT_MODES,
|
|
defaultValue: 'none',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls',
|
|
},
|
|
{
|
|
name: 'cert_dns_provider',
|
|
type: 'input',
|
|
label: 'cert_dns_provider',
|
|
placeholder: 'e.g. cloudflare, aliyun',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls' && p.cert_mode === 'dns',
|
|
},
|
|
{
|
|
name: 'cert_dns_env',
|
|
type: 'textarea',
|
|
label: 'cert_dns_env',
|
|
placeholder:
|
|
'CF_DNS_API_TOKEN=1234567890abcdefghijklmnopqrstuvwxyz\nALI_ACCESS_KEY_ID=your_access_key_id\nALI_ACCESS_KEY_SECRET=your_access_key_secret',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls' && p.cert_mode === 'dns',
|
|
},
|
|
],
|
|
hysteria: [
|
|
{
|
|
name: 'ratio',
|
|
type: 'number',
|
|
label: 'traffic_ratio',
|
|
min: 0,
|
|
step: 0.01,
|
|
defaultValue: 1,
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'port',
|
|
type: 'number',
|
|
label: 'port',
|
|
min: 1,
|
|
max: 65535,
|
|
placeholder: '1-65535',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'hop_ports',
|
|
type: 'input',
|
|
label: 'hop_ports',
|
|
placeholder: (t) => t('hop_ports_placeholder'),
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'hop_interval',
|
|
type: 'number',
|
|
label: 'hop_interval',
|
|
placeholder: 'e.g. 300',
|
|
min: 1,
|
|
suffix: 'S',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'obfs',
|
|
type: 'select',
|
|
label: 'obfs',
|
|
options: ['none', 'salamander'],
|
|
defaultValue: 'none',
|
|
group: 'obfs',
|
|
},
|
|
{
|
|
name: 'obfs_password',
|
|
type: 'input',
|
|
label: 'obfs_password',
|
|
placeholder: (t) => t('obfs_password_placeholder'),
|
|
generate: {
|
|
function: () => generatePassword(16),
|
|
},
|
|
group: 'obfs',
|
|
condition: (p) => p.obfs && p.obfs !== 'none',
|
|
},
|
|
{
|
|
name: 'up_mbps',
|
|
type: 'number',
|
|
label: 'up_mbps',
|
|
min: 1,
|
|
placeholder: (t) => t('bandwidth_placeholder'),
|
|
suffix: 'Mbps',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'down_mbps',
|
|
type: 'number',
|
|
label: 'down_mbps',
|
|
min: 1,
|
|
placeholder: (t) => t('bandwidth_placeholder'),
|
|
suffix: 'Mbps',
|
|
group: 'basic',
|
|
},
|
|
{ name: 'sni', type: 'input', label: 'security_sni', group: 'security' },
|
|
{ name: 'allow_insecure', type: 'switch', label: 'security_allow_insecure', group: 'security' },
|
|
{
|
|
name: 'fingerprint',
|
|
type: 'select',
|
|
label: 'security_fingerprint',
|
|
options: FINGERPRINTS,
|
|
defaultValue: 'chrome',
|
|
group: 'security',
|
|
},
|
|
{
|
|
name: 'cert_mode',
|
|
type: 'select',
|
|
label: 'cert_mode',
|
|
options: CERT_MODES,
|
|
defaultValue: 'none',
|
|
group: 'security',
|
|
},
|
|
{
|
|
name: 'cert_dns_provider',
|
|
type: 'input',
|
|
label: 'cert_dns_provider',
|
|
placeholder: 'e.g. cloudflare, aliyun',
|
|
group: 'security',
|
|
condition: (p) => p.cert_mode === 'dns',
|
|
},
|
|
{
|
|
name: 'cert_dns_env',
|
|
type: 'textarea',
|
|
label: 'cert_dns_env',
|
|
placeholder:
|
|
'CF_DNS_API_TOKEN=1234567890abcdefghijklmnopqrstuvwxyz\nALI_ACCESS_KEY_ID=your_access_key_id\nALI_ACCESS_KEY_SECRET=your_access_key_secret',
|
|
group: 'security',
|
|
condition: (p) => p.cert_mode === 'dns',
|
|
},
|
|
],
|
|
tuic: [
|
|
{
|
|
name: 'ratio',
|
|
type: 'number',
|
|
label: 'traffic_ratio',
|
|
min: 0,
|
|
step: 0.01,
|
|
defaultValue: 1,
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'port',
|
|
type: 'number',
|
|
label: 'port',
|
|
min: 1,
|
|
max: 65535,
|
|
placeholder: '1-65535',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'udp_relay_mode',
|
|
type: 'select',
|
|
label: 'udp_relay_mode',
|
|
options: TUIC_UDP_RELAY_MODES,
|
|
defaultValue: 'native',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'congestion_controller',
|
|
type: 'select',
|
|
label: 'congestion_controller',
|
|
options: TUIC_CONGESTION,
|
|
defaultValue: 'bbr',
|
|
group: 'basic',
|
|
},
|
|
{ name: 'disable_sni', type: 'switch', label: 'disable_sni', group: 'basic' },
|
|
{ name: 'reduce_rtt', type: 'switch', label: 'reduce_rtt', group: 'basic' },
|
|
{ name: 'sni', type: 'input', label: 'security_sni', group: 'security' },
|
|
{ name: 'allow_insecure', type: 'switch', label: 'security_allow_insecure', group: 'security' },
|
|
{
|
|
name: 'fingerprint',
|
|
type: 'select',
|
|
label: 'security_fingerprint',
|
|
options: FINGERPRINTS,
|
|
defaultValue: 'chrome',
|
|
group: 'security',
|
|
},
|
|
{
|
|
name: 'cert_mode',
|
|
type: 'select',
|
|
label: 'cert_mode',
|
|
options: CERT_MODES,
|
|
defaultValue: 'none',
|
|
group: 'security',
|
|
},
|
|
{
|
|
name: 'cert_dns_provider',
|
|
type: 'input',
|
|
label: 'cert_dns_provider',
|
|
placeholder: 'e.g. cloudflare, aliyun',
|
|
group: 'security',
|
|
condition: (p) => p.cert_mode === 'dns',
|
|
},
|
|
{
|
|
name: 'cert_dns_env',
|
|
type: 'textarea',
|
|
label: 'cert_dns_env',
|
|
placeholder:
|
|
'CF_DNS_API_TOKEN=1234567890abcdefghijklmnopqrstuvwxyz\nALI_ACCESS_KEY_ID=your_access_key_id\nALI_ACCESS_KEY_SECRET=your_access_key_secret',
|
|
group: 'security',
|
|
condition: (p) => p.cert_mode === 'dns',
|
|
},
|
|
],
|
|
socks: [
|
|
{
|
|
name: 'ratio',
|
|
type: 'number',
|
|
label: 'traffic_ratio',
|
|
min: 0,
|
|
step: 0.01,
|
|
defaultValue: 1,
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'port',
|
|
type: 'number',
|
|
label: 'port',
|
|
min: 1,
|
|
max: 65535,
|
|
placeholder: '1-65535',
|
|
group: 'basic',
|
|
},
|
|
],
|
|
naive: [
|
|
{
|
|
name: 'ratio',
|
|
type: 'number',
|
|
label: 'traffic_ratio',
|
|
min: 0,
|
|
step: 0.01,
|
|
defaultValue: 1,
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'port',
|
|
type: 'number',
|
|
label: 'port',
|
|
min: 1,
|
|
max: 65535,
|
|
placeholder: '1-65535',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'security',
|
|
type: 'select',
|
|
label: 'security',
|
|
options: SECURITY.naive,
|
|
defaultValue: 'none',
|
|
group: 'security',
|
|
},
|
|
{
|
|
name: 'sni',
|
|
type: 'input',
|
|
label: 'security_sni',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'allow_insecure',
|
|
type: 'switch',
|
|
label: 'security_allow_insecure',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'fingerprint',
|
|
type: 'select',
|
|
label: 'security_fingerprint',
|
|
options: FINGERPRINTS,
|
|
defaultValue: 'chrome',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'cert_mode',
|
|
type: 'select',
|
|
label: 'cert_mode',
|
|
options: CERT_MODES,
|
|
defaultValue: 'none',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls',
|
|
},
|
|
{
|
|
name: 'cert_dns_provider',
|
|
type: 'input',
|
|
label: 'cert_dns_provider',
|
|
placeholder: 'e.g. cloudflare, aliyun',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls' && p.cert_mode === 'dns',
|
|
},
|
|
{
|
|
name: 'cert_dns_env',
|
|
type: 'textarea',
|
|
label: 'cert_dns_env',
|
|
placeholder:
|
|
'CF_DNS_API_TOKEN=1234567890abcdefghijklmnopqrstuvwxyz\nALI_ACCESS_KEY_ID=your_access_key_id\nALI_ACCESS_KEY_SECRET=your_access_key_secret',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls' && p.cert_mode === 'dns',
|
|
},
|
|
],
|
|
http: [
|
|
{
|
|
name: 'ratio',
|
|
type: 'number',
|
|
label: 'traffic_ratio',
|
|
min: 0,
|
|
step: 0.01,
|
|
defaultValue: 1,
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'port',
|
|
type: 'number',
|
|
label: 'port',
|
|
min: 1,
|
|
max: 65535,
|
|
placeholder: '1-65535',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'security',
|
|
type: 'select',
|
|
label: 'security',
|
|
options: SECURITY.http,
|
|
defaultValue: 'none',
|
|
group: 'security',
|
|
},
|
|
{
|
|
name: 'sni',
|
|
type: 'input',
|
|
label: 'security_sni',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'allow_insecure',
|
|
type: 'switch',
|
|
label: 'security_allow_insecure',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'fingerprint',
|
|
type: 'select',
|
|
label: 'security_fingerprint',
|
|
options: FINGERPRINTS,
|
|
defaultValue: 'chrome',
|
|
group: 'security',
|
|
condition: (p) => p.security !== 'none',
|
|
},
|
|
{
|
|
name: 'cert_mode',
|
|
type: 'select',
|
|
label: 'cert_mode',
|
|
options: CERT_MODES,
|
|
defaultValue: 'none',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls',
|
|
},
|
|
{
|
|
name: 'cert_dns_provider',
|
|
type: 'input',
|
|
label: 'cert_dns_provider',
|
|
placeholder: 'e.g. cloudflare, aliyun',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls' && p.cert_mode === 'dns',
|
|
},
|
|
{
|
|
name: 'cert_dns_env',
|
|
type: 'textarea',
|
|
label: 'cert_dns_env',
|
|
placeholder:
|
|
'CF_DNS_API_TOKEN=1234567890abcdefghijklmnopqrstuvwxyz\nALI_ACCESS_KEY_ID=your_access_key_id\nALI_ACCESS_KEY_SECRET=your_access_key_secret',
|
|
group: 'security',
|
|
condition: (p) => p.security === 'tls' && p.cert_mode === 'dns',
|
|
},
|
|
],
|
|
mieru: [
|
|
{
|
|
name: 'ratio',
|
|
type: 'number',
|
|
label: 'traffic_ratio',
|
|
min: 0,
|
|
step: 0.01,
|
|
defaultValue: 1,
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'port',
|
|
type: 'number',
|
|
label: 'port',
|
|
min: 1,
|
|
max: 65535,
|
|
placeholder: '1-65535',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'multiplex',
|
|
type: 'select',
|
|
label: 'multiplex',
|
|
options: multiplexLevels,
|
|
defaultValue: 'off',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'transport',
|
|
type: 'select',
|
|
label: 'transport',
|
|
options: TRANSPORTS.mieru,
|
|
defaultValue: 'tcp',
|
|
group: 'transport',
|
|
},
|
|
],
|
|
anytls: [
|
|
{
|
|
name: 'ratio',
|
|
type: 'number',
|
|
label: 'traffic_ratio',
|
|
min: 0,
|
|
step: 0.01,
|
|
defaultValue: 1,
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'port',
|
|
type: 'number',
|
|
label: 'port',
|
|
min: 1,
|
|
max: 65535,
|
|
placeholder: '1-65535',
|
|
group: 'basic',
|
|
},
|
|
{
|
|
name: 'padding_scheme',
|
|
type: 'textarea',
|
|
label: 'padding_scheme',
|
|
placeholder: (t: (key: string) => string) => t('padding_scheme_placeholder'),
|
|
group: 'basic',
|
|
},
|
|
{ name: 'sni', type: 'input', label: 'security_sni', group: 'security' },
|
|
{ name: 'allow_insecure', type: 'switch', label: 'security_allow_insecure', group: 'security' },
|
|
{
|
|
name: 'fingerprint',
|
|
type: 'select',
|
|
label: 'security_fingerprint',
|
|
options: FINGERPRINTS,
|
|
defaultValue: 'chrome',
|
|
group: 'security',
|
|
},
|
|
{
|
|
name: 'cert_mode',
|
|
type: 'select',
|
|
label: 'cert_mode',
|
|
options: CERT_MODES,
|
|
defaultValue: 'none',
|
|
group: 'security',
|
|
},
|
|
{
|
|
name: 'cert_dns_provider',
|
|
type: 'input',
|
|
label: 'cert_dns_provider',
|
|
placeholder: 'e.g. cloudflare, aliyun',
|
|
group: 'security',
|
|
condition: (p) => p.cert_mode === 'dns',
|
|
},
|
|
{
|
|
name: 'cert_dns_env',
|
|
type: 'textarea',
|
|
label: 'cert_dns_env',
|
|
placeholder:
|
|
'CF_DNS_API_TOKEN=1234567890abcdefghijklmnopqrstuvwxyz\nALI_ACCESS_KEY_ID=your_access_key_id\nALI_ACCESS_KEY_SECRET=your_access_key_secret',
|
|
group: 'security',
|
|
condition: (p) => p.cert_mode === 'dns',
|
|
},
|
|
],
|
|
};
|