Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ButtplugNodeWebsocketServer

Derives from the base ButtplugServer class, adds capabilities to the server for listening on and communicating with websockets in a native node application.

Hierarchy

  • ButtplugServer
    • ButtplugNodeWebsocketServer

Index

Constructors

constructor

  • Parameters

    • name: string
    • Default value maxPingTime: number = 0

    Returns ButtplugNodeWebsocketServer

Properties

AddDeviceManager

AddDeviceManager: function

Type declaration

    • (aManager: IDeviceSubtypeManager): void
    • Parameters

      • aManager: IDeviceSubtypeManager

      Returns void

ClearDeviceManagers

ClearDeviceManagers: function

Type declaration

    • (): void
    • Returns void

DeviceManagers

DeviceManagers: IDeviceSubtypeManager[]

SendMessage

SendMessage: function

Type declaration

    • (aMessage: ButtplugMessage): Promise<ButtplugMessage>
    • Parameters

      • aMessage: ButtplugMessage

      Returns Promise<ButtplugMessage>

Shutdown

Shutdown: function

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

Static defaultMaxListeners

defaultMaxListeners: number

Methods

StartInsecureServer

  • StartInsecureServer(port?: number, host?: string): void
  • Starts an insecure (non-ssl) instance of the server. This server will not be accessible from clients/applications running on https instances.

    Parameters

    • Default value port: number = 12345

      Network port to listen on (defaults to 12345)

    • Default value host: string = "localhost"

      Host address to listen on (defaults to localhost)

    Returns void

StartSecureServer

  • StartSecureServer(certFilePath: string, keyFilePath: string, port?: number, host?: string): void
  • Starts a secure instance of the server. Requires an SSL certificate to already be generated.

    Parameters

    • certFilePath: string

      Path to certificate file

    • keyFilePath: string

      Path to certificate private key file

    • Default value port: number = 12345

      Network port to listen on (defaults to 12345)

    • Default value host: string = "localhost"

      Host address to listen on (defaults to localhost)

    Returns void

StopServer

  • StopServer(): Promise<Object>
  • Shuts down the server, closing all connections.

    Returns Promise<Object>

addListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

emit

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

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

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

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
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

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

    • event: string | symbol

    Returns Function[]

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
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

Static listenerCount

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

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc