UNPKG

@remnawave/xtls-sdk

Version:

A Typescript SDK for XRAY (XTLS) Core GRPC Api

36 lines 1.68 kB
import { Channel } from 'nice-grpc'; import { ISdkResponse } from '../common/types/sdk-response'; import { IAddSourceIpRule, IRemoveRuleByRuleTag } from './interfaces'; import { AddSourceIpRuleResponseModel } from './models'; import { RemoveRuleByRuleTagResponseModel } from './models/remove-rule-by-rule-tag'; /** * Service for managing routing rules in XRAY/XTLS * RoutingService is required (enable on XRay Config) to add/remove routing rules. */ export declare class RouterService { private readonly channel; private readonly client; /** * Creates an instance of RouterService * @param channel - The gRPC channel to use for communication */ constructor(channel: Channel); /** * Adds a new routing rule based on source IP address * @param dto - Data transfer object containing rule configuration * @param dto.ruleTag - Unique identifier for the rule * @param dto.outbound - Outbound tag to route matched traffic * @param dto.ip - Source IP address to match * @param dto.append - Whether to append the rule or replace existing rules * @returns Promise resolving to response indicating success or failure */ addSrcIpRule(dto: IAddSourceIpRule): Promise<ISdkResponse<AddSourceIpRuleResponseModel>>; /** * Removes a routing rule by its tag * @param dto - Data transfer object containing rule tag * @param dto.ruleTag - Tag of the rule to remove * @returns Promise resolving to response indicating success or failure */ removeRuleByRuleTag(dto: IRemoveRuleByRuleTag): Promise<ISdkResponse<RemoveRuleByRuleTagResponseModel>>; } //# sourceMappingURL=router.service.d.ts.map