IHttpConnectionOptions interface

Options provided to the 'withUrl' method on HubConnectionBuilder to configure options for the HTTP-based transports.

Properties

httpClient

An HttpClient that will be used to make HTTP requests.

logger

Configures the logger used for logging. Provide an ILogger instance, and log messages will be logged via that instance. Alternatively, provide a value from the LogLevel enumeration and a default logger which logs to the Console will be configured to log messages of the specified level (or higher).

logMessageContent

A boolean indicating if message content should be logged. Message content can contain sensitive user data, so this is disabled by default.

skipNegotiation

A boolean indicating if negotiation should be skipped. Negotiation can only be skipped when the transport property is set to 'HttpTransportType.WebSockets'.

transport

An HttpTransportType value specifying the transport to use for the connection.

Methods

accessTokenFactory

A function that provides an access token required for HTTP Bearer authentication.

Property Details

httpClient

An HttpClient that will be used to make HTTP requests.

httpClient?: HttpClient

Property Value

logger

Configures the logger used for logging. Provide an ILogger instance, and log messages will be logged via that instance. Alternatively, provide a value from the LogLevel enumeration and a default logger which logs to the Console will be configured to log messages of the specified level (or higher).

logger?: ILogger | LogLevel

Property Value

logMessageContent

A boolean indicating if message content should be logged. Message content can contain sensitive user data, so this is disabled by default.

logMessageContent?: boolean

Property Value

skipNegotiation

A boolean indicating if negotiation should be skipped. Negotiation can only be skipped when the transport property is set to 'HttpTransportType.WebSockets'.

skipNegotiation?: boolean

Property Value

transport

An HttpTransportType value specifying the transport to use for the connection.

transport?: HttpTransportType | ITransport

Property Value

Method Details

accessTokenFactory

A function that provides an access token required for HTTP Bearer authentication.

function accessTokenFactory()

Returns

string | Promise<string>