UpgradeResult
Upgrade result (either a websocket AsyncChannel, or an HTTP1 AsyncChannel)
enum UpgradeResult
Upgrade result (either a websocket AsyncChannel, or an HTTP1 AsyncChannel)
enum UpgradeResult
s20HummingbirdWebSocket05HTTP1bC14UpgradeChannelV0E6ResultO
What are these?4B19F
import HummingbirdWebSocket
struct HTTP1WebSocketUpgradeChannel
Child channel supporting a web socket upgrade from HTTP1
case websocket(NIOAsyncChannel<WebSocketFrame, WebSocketFrame>, WebSocketChannelHandler, Logger)
case notUpgraded(NIOAsyncChannel<HTTPRequestPart, HTTPResponsePart>)
case failedUpgrade(NIOAsyncChannel<HTTPRequestPart, HTTPResponsePart>, Logger)
init(responder: @escaping HTTPChannelHandler.Responder, configuration: WebSocketServerConfiguration, additionalChannelHandlers: @escaping () -> [any RemovableChannelHandler] = { [] }, shouldUpgrade: @escaping (HTTPRequest, Channel, Logger) async throws -> ShouldUpgradeResult<WebSocketDataHandler<Context>>)
Initialize HTTP1AndWebSocketChannel with async shouldUpgrade
function
init(responder: @escaping HTTPChannelHandler.Responder, configuration: WebSocketServerConfiguration, additionalChannelHandlers: @escaping () -> [any RemovableChannelHandler] = { [] }, shouldUpgrade: @escaping (HTTPRequest, Channel, Logger) throws -> ShouldUpgradeResult<WebSocketDataHandler<Context>>)
Initialize HTTP1AndWebSocketChannel with synchronous shouldUpgrade
function
init<WSResponder>(responder: @escaping HTTPChannelHandler.Responder, webSocketResponder: WSResponder, configuration: WebSocketServerConfiguration, additionalChannelHandlers: @escaping () -> [any RemovableChannelHandler] = { [] }) where WSResponder : HTTPResponder, WSResponder.Context : WebSocketRequestContext
Initialize HTTP1WebSocketUpgradeChannel with async shouldUpgrade
function
let responder: HTTPChannelHandler.Responder
func handle(value: Value, logger: Logger) async
Handle upgrade result output from channel
func setup(channel: Channel, logger: Logger) -> EventLoopFuture<Value>
Setup channel to accept HTTP1 with a WebSocket upgrade
struct Context
Basic context implementation of WebSocketContext
. Used by non-router web socket handle function
struct Value
typealias WebSocketChannelHandler = (NIOAsyncChannel<WebSocketFrame, WebSocketFrame>, Logger) async -> Void
init(responder: @escaping HTTPChannelHandler.Responder, additionalChannelHandlers: @escaping () -> [any RemovableChannelHandler] = { [] }, configuration: WebSocketServerConfiguration, shouldUpgrade: @escaping (HTTPRequest, Channel, Logger) async throws -> ShouldUpgradeResult<WebSocketDataHandler<Context>>)
protocol Sendable