@localzet/xtls-sdk
Version:
TypeScript SDK for XRAY/AURA Core
125 lines • 5.96 kB
TypeScript
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
import { IPOrDomain } from '../../common/net/address';
import { PortList } from '../../common/net/port';
import { TypedMessage } from '../../common/serial/typed_message';
import { ProxyConfig, StreamConfig } from '../../transport/internet/config';
export declare const protobufPackage = "xray.app.proxyman";
export interface InboundConfig {
$type: 'xray.app.proxyman.InboundConfig';
}
export interface AllocationStrategy {
$type: 'xray.app.proxyman.AllocationStrategy';
type: AllocationStrategy_Type;
/**
* Number of handlers (ports) running in parallel.
* Default value is 3 if unset.
*/
concurrency: AllocationStrategy_AllocationStrategyConcurrency | undefined;
/**
* Number of minutes before a handler is regenerated.
* Default value is 5 if unset.
*/
refresh: AllocationStrategy_AllocationStrategyRefresh | undefined;
}
export declare enum AllocationStrategy_Type {
/** Always - Always allocate all connection handlers. */
Always = 0,
/** Random - Randomly allocate specific range of handlers. */
Random = 1,
/** External - External. Not supported yet. */
External = 2,
UNRECOGNIZED = -1
}
export declare function allocationStrategy_TypeFromJSON(object: any): AllocationStrategy_Type;
export declare function allocationStrategy_TypeToJSON(object: AllocationStrategy_Type): string;
export interface AllocationStrategy_AllocationStrategyConcurrency {
$type: 'xray.app.proxyman.AllocationStrategy.AllocationStrategyConcurrency';
value: number;
}
export interface AllocationStrategy_AllocationStrategyRefresh {
$type: 'xray.app.proxyman.AllocationStrategy.AllocationStrategyRefresh';
value: number;
}
export interface SniffingConfig {
$type: 'xray.app.proxyman.SniffingConfig';
/** Whether or not to enable content sniffing on an inbound connection. */
enabled: boolean;
/**
* Override target destination if sniff'ed protocol is in the given list.
* Supported values are "http", "tls", "fakedns".
*/
destinationOverride: string[];
domainsExcluded: string[];
/**
* Whether should only try to sniff metadata without waiting for client input.
* Can be used to support SMTP like protocol where server send the first
* message.
*/
metadataOnly: boolean;
routeOnly: boolean;
}
export interface ReceiverConfig {
$type: 'xray.app.proxyman.ReceiverConfig';
/** PortList specifies the ports which the Receiver should listen on. */
portList: PortList | undefined;
/** Listen specifies the IP address that the Receiver should listen on. */
listen: IPOrDomain | undefined;
allocationStrategy: AllocationStrategy | undefined;
streamSettings: StreamConfig | undefined;
receiveOriginalDestination: boolean;
sniffingSettings: SniffingConfig | undefined;
}
export interface InboundHandlerConfig {
$type: 'xray.app.proxyman.InboundHandlerConfig';
tag: string;
receiverSettings: TypedMessage | undefined;
proxySettings: TypedMessage | undefined;
}
export interface OutboundConfig {
$type: 'xray.app.proxyman.OutboundConfig';
}
export interface SenderConfig {
$type: 'xray.app.proxyman.SenderConfig';
/** Send traffic through the given IP. Only IP is allowed. */
via: IPOrDomain | undefined;
streamSettings: StreamConfig | undefined;
proxySettings: ProxyConfig | undefined;
multiplexSettings: MultiplexingConfig | undefined;
viaCidr: string;
}
export interface MultiplexingConfig {
$type: 'xray.app.proxyman.MultiplexingConfig';
/** Whether or not Mux is enabled. */
enabled: boolean;
/** Max number of concurrent connections that one Mux connection can handle. */
concurrency: number;
/** Transport XUDP in another Mux. */
xudpConcurrency: number;
/** "reject" (default), "allow" or "skip". */
xudpProxyUDP443: string;
}
export declare const InboundConfig: MessageFns<InboundConfig, 'xray.app.proxyman.InboundConfig'>;
export declare const AllocationStrategy: MessageFns<AllocationStrategy, 'xray.app.proxyman.AllocationStrategy'>;
export declare const AllocationStrategy_AllocationStrategyConcurrency: MessageFns<AllocationStrategy_AllocationStrategyConcurrency, 'xray.app.proxyman.AllocationStrategy.AllocationStrategyConcurrency'>;
export declare const AllocationStrategy_AllocationStrategyRefresh: MessageFns<AllocationStrategy_AllocationStrategyRefresh, 'xray.app.proxyman.AllocationStrategy.AllocationStrategyRefresh'>;
export declare const SniffingConfig: MessageFns<SniffingConfig, 'xray.app.proxyman.SniffingConfig'>;
export declare const ReceiverConfig: MessageFns<ReceiverConfig, 'xray.app.proxyman.ReceiverConfig'>;
export declare const InboundHandlerConfig: MessageFns<InboundHandlerConfig, 'xray.app.proxyman.InboundHandlerConfig'>;
export declare const OutboundConfig: MessageFns<OutboundConfig, 'xray.app.proxyman.OutboundConfig'>;
export declare const SenderConfig: MessageFns<SenderConfig, 'xray.app.proxyman.SenderConfig'>;
export declare const MultiplexingConfig: MessageFns<MultiplexingConfig, 'xray.app.proxyman.MultiplexingConfig'>;
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
[K in Exclude<keyof T, '$type'>]?: DeepPartial<T[K]>;
} : Partial<T>;
export interface MessageFns<T, V extends string> {
readonly $type: V;
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
export {};
//# sourceMappingURL=config.d.ts.map