ProtocolUpgrade

abstract class ProtocolUpgrade : OutgoingContent

Variant of a OutgoingContent for upgrading an HTTP connection

Constructors

<init>

ProtocolUpgrade()

Variant of a OutgoingContent for upgrading an HTTP connection

Properties

status

val status: HttpStatusCode?

Status code to set when sending this content

Inherited Properties

contentLength

open val contentLength: Long?

Specifies content length in bytes for this resource.

contentType

open val contentType: ContentType?

Specifies ContentType for this resource.

headers

open val headers: Headers

Headers to set when sending this content

Functions

upgrade

abstract suspend fun upgrade(
    input: ByteReadChannel,
    output: ByteWriteChannel,
    engineContext: <ERROR CLASS>,
    userContext: <ERROR CLASS>
): Job

Upgrades an HTTP connection

Inherited Functions

getProperty

open fun <T : Any> getProperty(key: AttributeKey<T>): T?

Gets an extension property for this content

setProperty

open fun <T : Any> setProperty(
    key: AttributeKey<T>,
    value: T?
): Unit

Sets an extension property for this content

Inheritors

WebSocketUpgrade

class WebSocketUpgrade : ProtocolUpgrade

An OutgoingContent response object that could be used to respond(): it will cause application engine to perform HTTP upgrade and start websocket RAW session.