module Roda::RodaPlugins::Websockets::RequestMethods

def websocket(opts=OPTS)

of strings.
:protocols :: Set the protocols to accept, should be an array

websocket, except the following options are handled specially:
returns. +opts+ is an options hash used when creating the
block, and return the appropriate rack response after the block
If the request is a websocket request, yield a websocket to the
def websocket(opts=OPTS)
  if websocket?
    always do
      opts = Hash[roda_class.opts[:websockets_opts]].merge!(opts)
      ws = WebSocket.new(env, opts.delete(:protocols), opts)
      yield ws
      halt ws.rack_response
    end
  end
end