Context
Basic context implementation of WebSocketContext
. Used by non-router web socket handle function
struct Context
Basic context implementation of WebSocketContext
. Used by non-router web socket handle function
struct Context
s20HummingbirdWebSocket05HTTP1bC14UpgradeChannelV7ContextV
What are these?722D3
import HummingbirdWebSocket
struct HTTP1WebSocketUpgradeChannel
Child channel supporting a web socket upgrade from HTTP1
protocol WebSocketContext : Sendable
Protocol for WebSocket Data handling functions context parameter
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
enum UpgradeResult
Upgrade result (either a websocket AsyncChannel, or an HTTP1 AsyncChannel)
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
let logger: Logger