Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TcpProxy

A TCP propxy.

Hierarchy

  • DisposableBase
    • TcpProxy

Implements

  • Disposable

Index

Constructors

constructor

Properties

Protected _DISPOSABLES

_DISPOSABLES: vscode.Disposable[]

Stores disposable sub objects.

Protected _INTERVALS

_INTERVALS: Timer[]

Stores intervals.

Private _NAME_AND_DESC_RESOLVERS

_NAME_AND_DESC_RESOLVERS: deploy_contracts.KeyValuePairs<TcpProxyNameAndDescriptionResolver>

Protected _TIMEOUTS

_TIMEOUTS: Timer[]

Stores timeouts.

Private _destinations

_destinations: TcpProxyDestination[] = []

Private _filters

_filters: TcpProxyRemoteFilter[] = []

Private _server

_server: Server

id

id: number

Gets the ID of the proxy.

isDisposed

isDisposed: boolean

Gets if object has been disposed or not.

isDisposing

isDisposing: boolean

Gets if the 'dispose()' method is currently executed or not.

isInFinalizeState

isInFinalizeState: boolean

Gets if the object is disposed or currently disposing.

options

Gets the options for that proxy.

Optional opts

Static defaultMaxListeners

defaultMaxListeners: number

Accessors

isRunning

  • get isRunning(): boolean
  • Returns if the proxy is currently running or not.

    Returns boolean

port

  • get port(): number
  • Gets the port the proxy listens on.

    Returns number

Methods

addDestination

  • Adds a destination.

    Parameters

    • addr: string

      The address / hostname of the destination.

    • port: number

      The TCP port of the destination.

    Returns TcpProxyDestinationContext

    The context of the added destination.

addFilter

addListener

  • addListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

Protected cleanupIntervals

  • cleanupIntervals(): void
  • Cleansup all timeouts.

    Returns void

Private cleanupServer

  • cleanupServer(): Promise<boolean>

Protected cleanupTimeouts

  • cleanupTimeouts(): void
  • Cleansup all timeouts.

    Returns void

dispose

  • dispose(): void
  • inheritdoc

    Returns void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getNameAndDescriptionFor

Private isRemoteAllowed

  • isRemoteAllowed(addr: string, port: number): boolean
  • Parameters

    • addr: string
    • port: number

    Returns boolean

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

on

  • on(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

Protected onDispose

  • onDispose(): void
  • inheritdoc

    Returns void

once

  • once(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

setNameAndDescriptionResolver

start

  • start(): Promise<boolean>
  • Starts the proxy.

    Returns Promise<boolean>

    The promise that indicates if operation was successful or not.

Private startTunnel

  • startTunnel(localSocket: Socket, port: number): Promise<void>
  • Parameters

    • localSocket: Socket
    • port: number

    Returns Promise<void>

stop

  • stop(): Promise<boolean>
  • Stops the proxy.

    Returns Promise<boolean>

    The promise that indicates if operation was successful or not.

toggle

  • toggle(): Promise<boolean>
  • Toggles the "running state" of that proxy.

    Returns Promise<boolean>

    The promise that indicates if operation was successful or not.

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc