open (Net::SSH::Proxy::HTTP)

    # File lib/net/ssh/proxy/http.rb, line 42
            def open( host, port )
              connect_string = "CONNECT #{host}:#{port} HTTP/1.0"

              socket = TCPSocket.new( @proxy_host, @proxy_port )
              socket.puts connect_string
              socket.puts

              resp = parse_response( socket )

              return socket if resp[:code] == 200

              socket.shutdown
              raise ConnectError, resp.inspect unless resp[:code] == 407

              user = proxy_user
              passwd = proxy_password

              raise UnauthorizedError, "no proxy user given" unless user

              auth = resp[:headers]["Proxy-Authenticate"]
              scheme, parms = auth.split( / /, 2 )

              case scheme
                when "Basic"
                  credentials =
                    Base64.encode64( "#{user}:#{passwd}" ).gsub( /\n/, "" )
                else
                  raise NotImplementedError,
                    "authorization scheme #{scheme.inspect} is not supported"
              end

              socket = TCPSocket.new( @proxy_host, @proxy_port )
              socket.puts connect_string
              socket.puts "Proxy-Authorization: #{scheme} #{credentials}"
              socket.puts

              resp = parse_response( socket )

              raise ConnectError, resp.inspect if resp[:code] != 200

              return socket
            end