open (Net::SSH::Proxy::SOCKS4)

    # File lib/net/ssh/proxy/socks4.rb, line 52
            def open( host, port )
              sock = TCPSocket.new( @proxy_host, @proxy_port )

              ip_addr = IPAddr.new( Resolv.getaddress( host ) )

              packet = [ SOCKS_VERSION, SOCKS_CMD_CONNECT,
                         port.to_i, ip_addr.to_i,
                         proxy_user, 0 ].pack( "CCnNA*C" )
              sock.send packet, 0

              version, status, port, ip = sock.recv( 8 ).unpack( "CCnN" )
              if status != SOCKS_GRANTED
                sock.close
                raise ConnectError, "error connecting to proxy (#{status})"
              end

              return sock
            end