Instance Propertyhummingbird-websocket 2.2.0HummingbirdWebSocket
responder
WebSocketChannel.swift:298let responder: HTTPChannelHandler.Responder
let responder: HTTPChannelHandler.Responder
s20HummingbirdWebSocket05HTTP1bC14UpgradeChannelV9responderyy0A4Core7RequestV_AE14ResponseWriterVn7NIOCore0F0_ptYaYbKcvp
What are these?9KUG5
import HummingbirdWebSocket
struct HTTP1WebSocketUpgradeChannel
Child channel supporting a web socket upgrade from HTTP1
protocol HTTPChannelHandler : ServerChildChannel
Protocol for HTTP channels
typealias Responder = (Request, consuming ResponseWriter, Channel) async throws -> Void
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
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
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>>)