Method: Landline::Handlers::WebSockServer#initialize

Defined in:
lib/landline/extensions/websocket.rb

#initialize(path, parent:, **params, &callback) ⇒ WebSockServer

Returns a new instance of WebSockServer.

Parameters:

  • path (Object)
  • parent (Landline::Node)
  • params (Hash)

    options hash

  • callback (#call)

    callback to process request within

Options Hash (**params):

  • :version (Integer)

    protocol version

  • :protocols (Array<String>)

    array of supported sub-protocols

  • :secure (Boolean)

    true if the server will use wss:// protocol



247
248
249
250
251
252
253
254
255
# File 'lib/landline/extensions/websocket.rb', line 247

def initialize(path, parent:, **params, &callback)
  nodeparams = params.dup
  nodeparams.delete(:version)
  nodeparams.delete(:protocols)
  nodeparams.delete(:secure)
  super(path, parent: parent, **nodeparams)
  @callback = callback
  @params = params
end