class

Sellia::CLI::WebSocketProxy

Inherits Reference / Object

Manages a WebSocket connection to a local service for passthrough

Constants

Log = ::Log.for(self)

Constructors

new(request_id : String, host : String, port : Int32)
Source

Instance methods

close(code : UInt16 | Nil = nil, reason : String | Nil = nil)

Close the WebSocket connection

Source
closed?
Source
connect(path : String, headers : Hash(String, Array(String))) : Hash(String, Array(String)) | Nil

Attempt WebSocket upgrade to local service Returns response headers on success, nil on failure

Source
host
Source
host=(host : String)
Source
on_close

Set callback for connection close

Source
on_frame

Set callback for receiving frames from local WebSocket

Source
port
Source
port=(port : Int32)
Source
request_id
Source
request_id=(request_id : String)
Source
send_frame(opcode : UInt8, payload : Bytes)

Send a frame to the local WebSocket

Source