class

Sellia::Server::PendingWebSocket

Inherits Reference / Object

Tracks a pending WebSocket upgrade request

Constants

Log = ::Log.for(self)

Constructors

new(id : String, context : HTTP::Server::Context, tunnel_id : String)
Source

Instance methods

close

Close the WebSocket connection

Source
closed?
Source
complete_upgrade(response_headers : Hash(String, Array(String)))

Complete the WebSocket upgrade after client confirms local connection

Source
context
Source
context=(context : HTTP::Server::Context)
Source
created_at
Source
created_at=(created_at : Time)
Source
fail_upgrade(status : Int32, message : String)

Fail the WebSocket upgrade

Source
id=(id : String)
Source
on_close

Set callback for connection close

Source
on_frame

Set callback for receiving frames from external client

Source
send_frame(opcode : UInt8, payload : Bytes)

Send a frame to the external client

Source
socket

Get the WebSocket once upgrade is complete

Source
tunnel_id
Source
tunnel_id=(tunnel_id : String)
Source
wait_for_upgrade(timeout : Time::Span = 30.seconds) : Bool

Wait for upgrade to complete

Source