extension

fun <T : WebSocketExtension<*>> WebSocketSession.extension(
    extension: WebSocketExtensionFactory<*, T>
): T

Find the extensions using WebSocketExtensionFactory.

Exceptions

IllegalStateException - if the extension is not found.

Return extension instance.