Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ferrum/client/web_socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def initialize(url, max_receive_size, logger)
uri = URI.parse(@url)
port = uri.port || DEFAULT_PORTS[uri.scheme]

if port == 443
if port == 443 || url.scheme == 'wss'
tcp = TCPSocket.new(uri.host, port)
ssl_context = OpenSSL::SSL::SSLContext.new
@sock = OpenSSL::SSL::SSLSocket.new(tcp, ssl_context)
Expand Down
2 changes: 2 additions & 0 deletions lib/ferrum/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def add_target(params:, session_id: nil)
new_target = Target.new(@client, session_id, params)
# `put_if_absent` returns nil if added a new value or existing if there was one already
target = @targets.put_if_absent(new_target.id, new_target) || new_target
# on first iteration session_id may be null, then if session is present here we must set it to the target
target.session_id = session_id if session_id
@default_target ||= target

new_pending = Concurrent::IVar.new
Expand Down
Loading