2026-02-17 10:55:31 +00:00
|
|
|
import type { IRouteConfig } from '@push.rocks/smartproxy';
|
|
|
|
|
|
2026-02-16 11:25:16 +00:00
|
|
|
/**
|
|
|
|
|
* A stored remote ingress edge registration.
|
|
|
|
|
*/
|
|
|
|
|
export interface IRemoteIngress {
|
|
|
|
|
id: string;
|
|
|
|
|
name: string;
|
|
|
|
|
secret: string;
|
|
|
|
|
listenPorts: number[];
|
2026-03-19 21:30:06 +00:00
|
|
|
/** UDP listen ports (e.g. for QUIC/HTTP3). Derived from routes with transport 'udp' or 'all'. */
|
|
|
|
|
listenPortsUdp?: number[];
|
2026-02-16 11:25:16 +00:00
|
|
|
enabled: boolean;
|
2026-02-17 14:17:18 +00:00
|
|
|
/** Whether to auto-derive ports from remoteIngress-tagged routes. Defaults to true. */
|
|
|
|
|
autoDerivePorts: boolean;
|
2026-02-16 11:25:16 +00:00
|
|
|
tags?: string[];
|
|
|
|
|
createdAt: number;
|
|
|
|
|
updatedAt: number;
|
2026-02-17 14:17:18 +00:00
|
|
|
/** Effective ports (union of manual + derived) — only present in API responses. */
|
2026-02-17 11:56:54 +00:00
|
|
|
effectiveListenPorts?: number[];
|
2026-02-17 14:17:18 +00:00
|
|
|
/** Ports explicitly set by the user — only present in API responses. */
|
|
|
|
|
manualPorts?: number[];
|
|
|
|
|
/** Ports auto-derived from route configs — only present in API responses. */
|
|
|
|
|
derivedPorts?: number[];
|
2026-03-19 21:30:06 +00:00
|
|
|
/** Effective UDP ports (union of manual + derived) — only present in API responses. */
|
|
|
|
|
effectiveListenPortsUdp?: number[];
|
2026-02-16 11:25:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Runtime status of a remote ingress edge.
|
|
|
|
|
*/
|
|
|
|
|
export interface IRemoteIngressStatus {
|
|
|
|
|
edgeId: string;
|
|
|
|
|
connected: boolean;
|
|
|
|
|
publicIp: string | null;
|
|
|
|
|
activeTunnels: number;
|
|
|
|
|
lastHeartbeat: number | null;
|
|
|
|
|
connectedAt: number | null;
|
2026-04-26 12:14:51 +00:00
|
|
|
transportMode?: 'tcpTls' | 'quic' | 'quicWithFallback';
|
|
|
|
|
fallbackUsed?: boolean;
|
|
|
|
|
performance?: IRemoteIngressPerformanceEffective;
|
|
|
|
|
flowControl?: IRemoteIngressFlowControlStatus;
|
|
|
|
|
queues?: IRemoteIngressQueueStatus;
|
|
|
|
|
traffic?: IRemoteIngressTrafficStatus;
|
|
|
|
|
udp?: IRemoteIngressUdpStatus;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type TRemoteIngressPerformanceProfile = 'balanced' | 'throughput' | 'highConcurrency';
|
|
|
|
|
|
|
|
|
|
export interface IRemoteIngressPerformanceConfig {
|
|
|
|
|
profile?: TRemoteIngressPerformanceProfile;
|
|
|
|
|
maxStreamsPerEdge?: number;
|
|
|
|
|
totalWindowBudgetBytes?: number;
|
|
|
|
|
minStreamWindowBytes?: number;
|
|
|
|
|
maxStreamWindowBytes?: number;
|
|
|
|
|
sustainedStreamWindowBytes?: number;
|
|
|
|
|
quicDatagramReceiveBufferBytes?: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IRemoteIngressPerformanceEffective {
|
|
|
|
|
profile: TRemoteIngressPerformanceProfile;
|
|
|
|
|
maxStreamsPerEdge: number;
|
|
|
|
|
totalWindowBudgetBytes: number;
|
|
|
|
|
minStreamWindowBytes: number;
|
|
|
|
|
maxStreamWindowBytes: number;
|
|
|
|
|
sustainedStreamWindowBytes: number;
|
|
|
|
|
quicDatagramReceiveBufferBytes: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IRemoteIngressFlowControlStatus {
|
|
|
|
|
applies: boolean;
|
|
|
|
|
currentWindowBytes: number;
|
|
|
|
|
minWindowBytes: number;
|
|
|
|
|
maxWindowBytes: number;
|
|
|
|
|
totalWindowBudgetBytes: number;
|
|
|
|
|
estimatedInFlightBytes: number;
|
|
|
|
|
stalledStreams: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IRemoteIngressQueueStatus {
|
|
|
|
|
ctrlQueueDepth: number;
|
|
|
|
|
dataQueueDepth: number;
|
|
|
|
|
sustainedQueueDepth: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IRemoteIngressTrafficStatus {
|
|
|
|
|
bytesIn: number;
|
|
|
|
|
bytesOut: number;
|
|
|
|
|
streamsOpenedTotal: number;
|
|
|
|
|
streamsClosedTotal: number;
|
|
|
|
|
rejectedStreams: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IRemoteIngressUdpStatus {
|
|
|
|
|
activeSessions: number;
|
|
|
|
|
droppedDatagrams: number;
|
2026-02-16 11:25:16 +00:00
|
|
|
}
|
2026-02-17 10:55:31 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Route-level remote ingress configuration.
|
|
|
|
|
* When attached to a route, signals that traffic for this route
|
|
|
|
|
* should be accepted from remote edge nodes.
|
|
|
|
|
*/
|
|
|
|
|
export interface IRouteRemoteIngress {
|
|
|
|
|
/** Whether this route receives traffic from edge nodes */
|
|
|
|
|
enabled: boolean;
|
|
|
|
|
/** Optional filter: only edges whose id or tags match get this route's ports.
|
|
|
|
|
* When absent, the route applies to all edges. */
|
|
|
|
|
edgeFilter?: string[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Extended route config used within dcrouter.
|
2026-04-05 00:37:37 +00:00
|
|
|
* Adds optional `remoteIngress` and `vpnOnly` properties to SmartProxy's IRouteConfig.
|
2026-02-17 10:55:31 +00:00
|
|
|
* SmartProxy ignores unknown properties at runtime.
|
|
|
|
|
*/
|
|
|
|
|
export type IDcRouterRouteConfig = IRouteConfig & {
|
|
|
|
|
remoteIngress?: IRouteRemoteIngress;
|
2026-04-05 00:37:37 +00:00
|
|
|
/** When true, only VPN clients whose TargetProfile matches this route get access.
|
|
|
|
|
* Matching is determined by domain overlap, target overlap, or direct routeRef. */
|
|
|
|
|
vpnOnly?: boolean;
|
2026-02-17 10:55:31 +00:00
|
|
|
};
|