Перейти к содержимому
docs.
WORKSPACE

Документации проектов

Открыть каталог проектов
Localzet ServerАсинхронный PHP-серверTriangleФреймворк и компонентыMIX IDИдентификация и интеграцииHack APIПубличные API хакатонаACNПроект и компонентыUserlay / UserNetПроект и компоненты✓AxiomПроект и компонентыМесседжинг через почтуПроект и компонентыLWT / JWT / JOSEПроект и компонентыФинансовая аналитика KimaiПроект и компонентыМультипарадигмальная БДПроект и компонентыZorin PlatformПроект и компонентыZorin TrustПроект и компонентыFloraScope / VegwatchПроект и компонентыaegis-qДокументация проектаaevumdbДокументация проектаauditДокументация проектаauto-invest-managerАвтотрейдерcaine-companionДокументация проектаcertbot-cloudflareДокументация проектаClusterLocalzet Server / ClustercmdveilДокументация проектаConsolePHP CLICronБиблиотеки Localzet Serverdata-connectorДокументация проектаdevice-controlDevice Controlenn-projectДокументация проектаEventsБиблиотеки Localzet ServerflowsintДокументация проектаforgeДокументация проектаHttpClientБиблиотеки Localzet ServerinterpreterСобственный языкinvariaДокументация проектаkeynotesДокументация проектаknotrouteKnotroutelaravel-personal-analyticsДокументация проектаlocalzet-osДокументация проектаmeridianДокументация проектаMQTTБиблиотеки Localzet Servernano-kernelСобственная ОСNoterДокументация проектаpersonal-analyticsДокументация проектаProxyБиблиотеки Localzet ServerPSRБиблиотеки Localzet ServerPSR-7Библиотеки Localzet Serverrschs-monitorДокументация проектаsemsealДокументация проектаshardsealДокументация проектаSocketIOБиблиотеки Localzet ServerSOCKS5Библиотеки Localzet Serverstandalone-analyticsДокументация проектаstatic-php-cliДокументация проектаStorageБиблиотеки Localzet ServersutureДокументация проектаtempoweaveДокументация проектаttsСинтез речиTunnelБиблиотеки Localzet Serverui-kitUI KitvesperДокументация проектаWebAnalyzerWebAnalyzerzorin-access-brokerДокументация проектаzorin-authority-brokerДокументация проектаzorin-authority-sdk-phpДокументация проектаzorin-authority-sdk-pythonДокументация проектаzorin-authority-sdk-tsДокументация проектаzorin-client-intelДокументация проектаzorin-device-core-aospДокументация проектаzorin-host-agentДокументация проектаzorin-native-labДокументация проектаzorin-nodeДокументация проектаzorin-opsДокументация проектаdonstu-python-sdkДокументация проектаfloortraceFloortraceserver-rsLocalzet Server / Cluster
Каталог
Документация/Userlay / UserNet

xray-configurator — API

src/domain/exampleCatalog.generated.ts

export type ExampleConfig = Record<string, unknown>;

src/domain/exampleCatalog.generated.ts

export interface ExampleCatalogItem {
id: string;
title: string;
path: string;
role: 'server' | 'client' | 'mixed' | 'other';
protocols: string[];
transports: string[];
securities: string[];
features: string[];
raw: string;
config: ExampleConfig | null;
}

src/domain/presets.ts

export interface ConfigPreset {
id: string;
label: string;
labelRu: string;
description: string;
descriptionRu: string;
create: () => XrayConfig;
}

src/domain/validation.ts

export type ValidationSeverity = 'error' | 'warning';

src/domain/validation.ts

export interface ValidationIssue {
path: string;
severity: ValidationSeverity;
message: string;
messageRu: string;
}

src/domain/validation.ts

export function validateConfig(config: XrayConfig): ValidationIssue[]

src/domain/xray.ts

export type Language = 'en' | 'ru';

src/domain/xray.ts

export type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue };

src/domain/xray.ts

export interface XrayConfig {
log?: Record<string, JsonValue>;
api?: Record<string, JsonValue>;
dns?: Record<string, JsonValue>;
routing?: Record<string, JsonValue>;
policy?: Record<string, JsonValue>;
inbounds?: InboundConfig[];
outbounds?: OutboundConfig[];
stats?: Record<string, JsonValue>;
fakeDns?: Record<string, JsonValue>;
metrics?: Record<string, JsonValue>;
observatory?: Record<string, JsonValue>;
burstObservatory?: Record<string, JsonValue>;
geodata?: Record<string, JsonValue>;
version?: Record<string, JsonValue>;
}

src/domain/xray.ts

export interface InboundConfig {
tag: string;
listen?: string;
port?: number | string;
protocol: InboundProtocol;
settings: Record<string, JsonValue>;
streamSettings?: StreamSettings;
sniffing?: Record<string, JsonValue>;
}

src/domain/xray.ts

export interface OutboundConfig {
tag: string;
protocol: OutboundProtocol;
settings: Record<string, JsonValue>;
sendThrough?: string;
targetStrategy?: string;
streamSettings?: StreamSettings;
proxySettings?: Record<string, JsonValue>;
mux?: Record<string, JsonValue>;
}

src/domain/xray.ts

export type InboundProtocol =
| 'vless'
| 'vmess'
| 'trojan'
| 'shadowsocks'
| 'socks'
| 'mixed'
| 'http'
| 'dokodemo-door'
| 'wireguard'
| 'hysteria'
| 'tun';

src/domain/xray.ts

export type OutboundProtocol =
| 'freedom'
| 'blackhole'
| 'dns'
| 'vless'
| 'vmess'
| 'trojan'
| 'shadowsocks'
| 'socks'
| 'http'
| 'wireguard'
| 'hysteria'
| 'loopback';

src/domain/xray.ts

export type TransportProtocol =
'raw'
| 'tcp'
| 'ws'
| 'grpc'
| 'xhttp'
| 'splithttp'
| 'kcp'
| 'httpupgrade'
| 'hysteria';

src/domain/xray.ts

export type SecurityProtocol = 'none' | 'tls' | 'reality';

src/domain/xray.ts

export interface StreamSettings {
network?: TransportProtocol;
security?: SecurityProtocol;
tcpSettings?: Record<string, JsonValue>;
rawSettings?: Record<string, JsonValue>;
wsSettings?: Record<string, JsonValue>;
grpcSettings?: Record<string, JsonValue>;
xhttpSettings?: Record<string, JsonValue>;
splithttpSettings?: Record<string, JsonValue>;
kcpSettings?: Record<string, JsonValue>;
httpupgradeSettings?: Record<string, JsonValue>;
hysteriaSettings?: Record<string, JsonValue>;
tlsSettings?: Record<string, JsonValue>;
realitySettings?: Record<string, JsonValue>;
sockopt?: Record<string, JsonValue>;
}

src/domain/xray.ts

export interface FieldDefinition {
key: string;
label: string;
labelRu: string;
help: string;
helpRu: string;
kind: 'text' | 'number' | 'switch' | 'select' | 'tags' | 'textarea' | 'json' | 'password';
options?: string[];
placeholder?: string;
secret?: boolean;
}

src/domain/xray.ts

export interface ProtocolDefinition {
value: string;
label: string;
server: boolean;
help: string;
helpRu: string;
fields: FieldDefinition[];
defaultSettings: Record<string, JsonValue>;
}

src/domain/xray.ts

export function field(
key: string,
label: string,
labelRu: string,
help: string,
helpRu: string,
kind: FieldDefinition['kind'],
options?: string[],
placeholder?: string,
): FieldDefinition

src/domain/xray.ts

export function randomHex(bytes: number): string

src/domain/xray.ts

export function randomBase64Url(bytes: number): string

src/domain/xray.ts

export function randomToken(bytes = 18): string

src/domain/xray.ts

export function pruneEmpty(value: JsonValue): JsonValue | undefined

src/domain/xray.ts

export function getProtocol<T extends ProtocolDefinition>(items: T[], value: string): T