Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

Hierarchy

Index

Constructors

  • Type parameters

    Parameters

    Returns Server<T>

Properties

clients: Set<T>
path: string

Methods

  • addListener(event: "connection", cb: (client: T, request: IncomingMessage) => void): Server<T>
  • addListener(event: "error", cb: (err: Error) => void): Server<T>
  • addListener(event: "headers", cb: (headers: string[], request: IncomingMessage) => void): Server<T>
  • addListener(event: "close" | "listening", cb: () => void): Server<T>
  • addListener(event: string | symbol, listener: (...args: any[]) => void): Server<T>
  • Parameters

    • event: "connection"
    • cb: (client: T, request: IncomingMessage) => void
        • (client: T, request: IncomingMessage): void
        • Parameters

          • client: T
          • request: IncomingMessage

          Returns void

    Returns Server<T>

  • Parameters

    • event: "error"
    • cb: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns Server<T>

  • Parameters

    • event: "headers"
    • cb: (headers: string[], request: IncomingMessage) => void
        • (headers: string[], request: IncomingMessage): void
        • Parameters

          • headers: string[]
          • request: IncomingMessage

          Returns void

    Returns Server<T>

  • Parameters

    • event: "close" | "listening"
    • cb: () => void
        • (): void
        • Returns void

    Returns Server<T>

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Server<T>

  • close(cb?: (err?: Error) => void): void
  • Parameters

    • Optional cb: (err?: Error) => void
        • (err?: Error): void
        • Parameters

          • Optional err: Error

          Returns void

    Returns void

  • handleUpgrade(request: IncomingMessage, socket: Duplex, upgradeHead: Buffer, callback: (client: T, request: IncomingMessage) => void): void
  • Parameters

    • request: IncomingMessage
    • socket: Duplex
    • upgradeHead: Buffer
    • callback: (client: T, request: IncomingMessage) => void
        • (client: T, request: IncomingMessage): void
        • Parameters

          • client: T
          • request: IncomingMessage

          Returns void

    Returns void

  • off(event: "connection", cb: (this: Server<T>, socket: T, request: IncomingMessage) => void): Server<T>
  • off(event: "error", cb: (this: Server<T>, error: Error) => void): Server<T>
  • off(event: "headers", cb: (this: Server<T>, headers: string[], request: IncomingMessage) => void): Server<T>
  • off(event: "close" | "listening", cb: (this: Server<T>) => void): Server<T>
  • off(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): Server<T>
  • Parameters

    • event: "connection"
    • cb: (this: Server<T>, socket: T, request: IncomingMessage) => void
        • (this: Server<T>, socket: T, request: IncomingMessage): void
        • Parameters

          • this: Server<T>
          • socket: T
          • request: IncomingMessage

          Returns void

    Returns Server<T>

  • Parameters

    • event: "error"
    • cb: (this: Server<T>, error: Error) => void
        • (this: Server<T>, error: Error): void
        • Parameters

          Returns void

    Returns Server<T>

  • Parameters

    • event: "headers"
    • cb: (this: Server<T>, headers: string[], request: IncomingMessage) => void
        • (this: Server<T>, headers: string[], request: IncomingMessage): void
        • Parameters

          • this: Server<T>
          • headers: string[]
          • request: IncomingMessage

          Returns void

    Returns Server<T>

  • Parameters

    • event: "close" | "listening"
    • cb: (this: Server<T>) => void
        • Parameters

          Returns void

    Returns Server<T>

  • Parameters

    • event: string | symbol
    • listener: (this: Server<T>, ...args: any[]) => void
        • (this: Server<T>, ...args: any[]): void
        • Parameters

          • this: Server<T>
          • Rest ...args: any[]

          Returns void

    Returns Server<T>

  • on(event: "connection", cb: (this: Server<T>, socket: T, request: IncomingMessage) => void): Server<T>
  • on(event: "error", cb: (this: Server<T>, error: Error) => void): Server<T>
  • on(event: "headers", cb: (this: Server<T>, headers: string[], request: IncomingMessage) => void): Server<T>
  • on(event: "close" | "listening", cb: (this: Server<T>) => void): Server<T>
  • on(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): Server<T>
  • Parameters

    • event: "connection"
    • cb: (this: Server<T>, socket: T, request: IncomingMessage) => void
        • (this: Server<T>, socket: T, request: IncomingMessage): void
        • Parameters

          • this: Server<T>
          • socket: T
          • request: IncomingMessage

          Returns void

    Returns Server<T>

  • Parameters

    • event: "error"
    • cb: (this: Server<T>, error: Error) => void
        • (this: Server<T>, error: Error): void
        • Parameters

          Returns void

    Returns Server<T>

  • Parameters

    • event: "headers"
    • cb: (this: Server<T>, headers: string[], request: IncomingMessage) => void
        • (this: Server<T>, headers: string[], request: IncomingMessage): void
        • Parameters

          • this: Server<T>
          • headers: string[]
          • request: IncomingMessage

          Returns void

    Returns Server<T>

  • Parameters

    • event: "close" | "listening"
    • cb: (this: Server<T>) => void
        • Parameters

          Returns void

    Returns Server<T>

  • Parameters

    • event: string | symbol
    • listener: (this: Server<T>, ...args: any[]) => void
        • (this: Server<T>, ...args: any[]): void
        • Parameters

          • this: Server<T>
          • Rest ...args: any[]

          Returns void

    Returns Server<T>

  • once(event: "connection", cb: (this: Server<T>, socket: T, request: IncomingMessage) => void): Server<T>
  • once(event: "error", cb: (this: Server<T>, error: Error) => void): Server<T>
  • once(event: "headers", cb: (this: Server<T>, headers: string[], request: IncomingMessage) => void): Server<T>
  • once(event: "close" | "listening", cb: (this: Server<T>) => void): Server<T>
  • once(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): Server<T>
  • Parameters

    • event: "connection"
    • cb: (this: Server<T>, socket: T, request: IncomingMessage) => void
        • (this: Server<T>, socket: T, request: IncomingMessage): void
        • Parameters

          • this: Server<T>
          • socket: T
          • request: IncomingMessage

          Returns void

    Returns Server<T>

  • Parameters

    • event: "error"
    • cb: (this: Server<T>, error: Error) => void
        • (this: Server<T>, error: Error): void
        • Parameters

          Returns void

    Returns Server<T>

  • Parameters

    • event: "headers"
    • cb: (this: Server<T>, headers: string[], request: IncomingMessage) => void
        • (this: Server<T>, headers: string[], request: IncomingMessage): void
        • Parameters

          • this: Server<T>
          • headers: string[]
          • request: IncomingMessage

          Returns void

    Returns Server<T>

  • Parameters

    • event: "close" | "listening"
    • cb: (this: Server<T>) => void
        • Parameters

          Returns void

    Returns Server<T>

  • Parameters

    • event: string | symbol
    • listener: (this: Server<T>, ...args: any[]) => void
        • (this: Server<T>, ...args: any[]): void
        • Parameters

          • this: Server<T>
          • Rest ...args: any[]

          Returns void

    Returns Server<T>

  • removeListener(event: "connection", cb: (client: T) => void): Server<T>
  • removeListener(event: "error", cb: (err: Error) => void): Server<T>
  • removeListener(event: "headers", cb: (headers: string[], request: IncomingMessage) => void): Server<T>
  • removeListener(event: "close" | "listening", cb: () => void): Server<T>
  • removeListener(event: string | symbol, listener: (...args: any[]) => void): Server<T>
  • Parameters

    • event: "connection"
    • cb: (client: T) => void
        • (client: T): void
        • Parameters

          • client: T

          Returns void

    Returns Server<T>

  • Parameters

    • event: "error"
    • cb: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns Server<T>

  • Parameters

    • event: "headers"
    • cb: (headers: string[], request: IncomingMessage) => void
        • (headers: string[], request: IncomingMessage): void
        • Parameters

          • headers: string[]
          • request: IncomingMessage

          Returns void

    Returns Server<T>

  • Parameters

    • event: "close" | "listening"
    • cb: () => void
        • (): void
        • Returns void

    Returns Server<T>

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Server<T>

  • shouldHandle(request: IncomingMessage): boolean | Promise<boolean>
  • Parameters

    • request: IncomingMessage

    Returns boolean | Promise<boolean>