StreamableHttpServerTransport

constructor(enableJsonResponse: Boolean = false, enableDnsRebindingProtection: Boolean = false, allowedHosts: List<String>? = null, allowedOrigins: List<String>? = null, eventStore: EventStore? = null, retryIntervalMillis: Long? = null)(source)

Parameters

enableJsonResponse

If true, the server will return JSON responses instead of starting an SSE stream. This can be useful for simple request/response scenarios without streaming. Default is false (SSE streams are preferred).

enableDnsRebindingProtection

Enable DNS rebinding protection (requires allowedHosts and/or allowedOrigins to be configured). Default is false for backwards compatibility.

allowedHosts

List of allowed host header values for DNS rebinding protection. If not specified, host validation is disabled.

allowedOrigins

List of allowed origin header values for DNS rebinding protection. If not specified, origin validation is disabled.

eventStore

Event store for resumability support If provided, resumability will be enabled, allowing clients to reconnect and resume messages

retryIntervalMillis

Retry interval (in milliseconds) advertised via SSE priming events to hint the client when to reconnect. Applies only when an eventStore is configured. Defaults to null (no retry hint).