Class: Charai::WebSocket::DriverImpl::SecureSocketFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/charai/web_socket.rb

Instance Method Summary collapse

Constructor Details

#initialize(host, port) ⇒ SecureSocketFactory

Returns a new instance of SecureSocketFactory.



11
12
13
14
# File 'lib/charai/web_socket.rb', line 11

def initialize(host, port)
  @host = host
  @port = port || 443
end

Instance Method Details

#createObject



16
17
18
19
# File 'lib/charai/web_socket.rb', line 16

def create
  tcp_socket = TCPSocket.new(@host, @port)
  OpenSSL::SSL::SSLSocket.new(tcp_socket).tap(&:connect)
end