lib/net/ssh/proxy/http.rb in net-ssh-2.10.0.beta1 vs lib/net/ssh/proxy/http.rb in net-ssh-2.10.0.beta2

- old
+ new

@@ -46,11 +46,12 @@ @options = options end # Return a new socket connected to the given host and port via the # proxy that was requested when the socket factory was instantiated. - def open(host, port, connection_options = nil) - socket = TCPSocket.new(proxy_host, proxy_port) + def open(host, port, connection_options) + socket = Socket.tcp(proxy_host, proxy_port, nil, nil, + connect_timeout: connection_options[:timeout]) socket.write "CONNECT #{host}:#{port} HTTP/1.0\r\n" if options[:user] credentials = ["#{options[:user]}:#{options[:password]}"].pack("m*").gsub(/\s/, "") socket.write "Proxy-Authorization: Basic #{credentials}\r\n"