NexusSW/nio4r-websocket

View on GitHub
lib/nio/websocket/adapter/client.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
require "nio/websocket/adapter"

module NIO
  module WebSocket
    class Adapter
      class Client < Adapter
        def initialize(url, io, options)
          @url = url
          driver = ::WebSocket::Driver.client(self, options[:websocket_options] || {})
          super io, driver, options
          WebSocket.logger.debug "Initiating handshake on #{io}"
          driver.start
        end
        attr_reader :url
      end
    end
  end
end