TwurpleAuthenticationGetting dataExamplesFAQMigration

ConnectionAdapter

An abstraction of a WebHook connection adapter.

Overview

Properties

listenerPort

Type: ?number

The port the HTTP server should listen on.

If not given, the listener will default to use port 443.

listenUsingSsl

Type: boolean

Whether the connection adapter listens using SSL.

pathPrefix

Type: ?string

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

usePathPrefixInHandlers

Type: boolean

Whether the path prefix is passed to the handler.

Defaults to false which means that the layer redirecting to this server needs to strip the path prefix in order for it to work.

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

Conversely, if this is set to true, the path should be passed as is (i.e. /hooks/abc).

Methods

createHttpServer()

Creates the HTTP server to use for listening to events.

Return type: Server<typeof IncomingMessage, typeof ServerResponse>

getHostName()

async

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

Return type: string