UNPKG

@ntrip/caster

Version:
69 lines (68 loc) 2.32 kB
/// <reference types="node" /> import { SingleConnectionTransport } from '../transport'; import { NtripVersion } from '../'; import { CasterTransportDefinition, CasterTransportInterface } from '../../caster'; import tls = require('tls'); export interface NtripPushPullTransportOptions { mode: 'push' | 'pull'; remote: { host: string; port: number; family?: string; }; tls?: tls.SecureContextOptions & tls.CommonConnectionOptions; protocol: 'http' | 'rtsp' | 'rtp'; localMountpoint: string; remoteMountpoint: string; ntripVersion: NtripVersion; localStr?: string; localGga?: string; remoteStr?: string; remoteGga?: string; credentials?: { basic?: { username: string; password: string; }; bearer?: string; secret?: string; }; } export interface NtripPushPullTransportConnectionProperties { protocol: 'http' | 'https' | 'rtsp' | 'rtsps' | 'rtp'; remote: { host: string; port: number; family: string; }; agent?: string; version: NtripVersion; toString: () => string; } export declare class NtripPushPullTransport extends SingleConnectionTransport { private readonly options; private agent?; private rtpSocket?; private rtpSession?; get description(): string; connectionDescription(source: any): string; protected constructor(manager: CasterTransportInterface, options: NtripPushPullTransportOptions); static new(options: NtripPushPullTransportOptions): CasterTransportDefinition; open(): void; close(): void; /** * Abstract request instance processor * * Mainly used to improve organization of code and avoid complex function names for various combinations of * protocols and versions. Request processors are initially created by {@link NtripTransport#accept}. * * Contains properties for reference to the parent transport, overall caster manager, and request/response objects. */ private static RequestFormer; /** HTTP request instance processor */ private static HttpRequestFormer; /** RTSP request instance processor */ private static RtspRequestFormer; /** RTP request instance processor */ private static RtpRequestFormer; }