twitcheasy-twitch-bottwitch-authtwitch-auth-tmitwitch-chat-clienttwitch-eventsubtwitch-pubsub-clienttwitch-webhooks

ConnectionAdapter

An abstraction of a WebHook connection adapter.

Overview

Constructor

new ConnectionAdapter(options)

Creates a new instance of the connection adapter.

Parameter Type Required Default Description
options CommonConnectionAdapterConfig none

Properties

connectUsingSsl

Type: boolean

Whether to use SSL to connect to the server.

This has nothing to do with the SSL configuration given. For example, this can be true when a reverse proxy takes care of SSL and routes to this server internally using plain HTTP.

listenUsingSsl

Type: boolean

Whether the connection adapter listens using SSL.

overrideOptions

Type: ConnectionAdapterOverrideOptions

Options to override when using the adapter.

pathPrefix

Type: ?string

The path prefix an external connection needs to reach the server.

Please note that the layer redirecting to this server needs to strip the path prefix in order for this to work.

For example, if this is set to /hooks, an external connection to /hooks/abc should pass /abc as the path to this server.

Methods

createHttpServer()

Creates the HTTP server to use for listening to events.

Return type: Server

getExternalPort()

async

Returns the port that should be used by Twitch to connect to the server.

Return type: number

getHostName()

async

Returns the host name that should be used by Twitch to connect to the server.

Return type: string

getListenerPort()

async

The port the HTTP server should listen on.

Return type: number