pub async fn connectivity(&self, target_urls: &[String]) -> Result<Vec<String>> {
        log::trace!("enter: connectivity_test({:?})", target_urls);

        let mut good_urls = vec![];

        for target_url in target_urls {
            let url = FeroxUrl::from_string(target_url, self.handles.clone());
            let request = skip_fail!(url.format("", None));

            let result = logged_request(&request, self.handles.clone()).await;

            match result {
                Ok(_) => {
                    good_urls.push(target_url.to_owned());
                }
                Err(e) => {
                    if matches!(
                        self.handles.config.output_level,
                        OutputLevel::Default | OutputLevel::Quiet
                    ) {
                        if e.to_string().contains(":SSL") {
                            ferox_print(
                                &format!("Could not connect to {} due to SSL errors (run with -k to ignore), skipping...", target_url),
                                &PROGRESS_PRINTER,
                            );
                        } else {
                            ferox_print(
                                &format!("Could not connect to {}, skipping...", target_url),
                                &PROGRESS_PRINTER,
                            );
                        }
                    }
                    log::warn!("{}", e);
                }
            }
        }

        if good_urls.is_empty() {
            bail!("Could not connect to any target provided");
        }

        log::trace!("exit: connectivity_test -> {:?}", good_urls);
        Ok(good_urls)
    }
/// Simply tries to connect to all given sites before starting to scan
///
/// In the event that no sites can be reached, the program will exit.
///
/// Any urls that are found to be alive are returned to the caller.
Simply tries to connect to all given sites before starting to scan
In the event that no sites can be reached, the program will exit.

Any urls that are found to be alive are returned to the caller.
Simply tries to connect to all given sites before starting to scan In the event that no sites can be reached the program will exit . Any urls that are found to be alive are returned to the caller .
pub async fn connectivity(&self, target_urls: &[String]) -> Result<Vec<String>> {
        log::trace!("enter: connectivity_test({:?})", target_urls);
        let mut good_urls = vec![];
        for target_url in target_urls {
            let url = FeroxUrl::from_string(target_url, self.handles.clone());
            let request = skip_fail!(url.format("", None));
            let result = logged_request(&request, self.handles.clone()).await;
            match result {
                Ok(_) => {
                    good_urls.push(target_url.to_owned());
                }
                Err(e) => {
                    if matches!(
                        self.handles.config.output_level,
                        OutputLevel::Default | OutputLevel::Quiet
                    ) {
                        if e.to_string().contains(":SSL") {
                            ferox_print(
                                &format!("Could not connect to {} due to SSL errors (run with -k to ignore), skipping...", target_url),
                                &PROGRESS_PRINTER,
                            );
                        } else {
                            ferox_print(
                                &format!("Could not connect to {}, skipping...", target_url),
                                &PROGRESS_PRINTER,
                            );
                        }
                    }
                    log::warn!("{}", e);
                }
            }
        }
        if good_urls.is_empty() {
            bail!("Could not connect to any target provided");
        }
        log::trace!("exit: connectivity_test -> {:?}", good_urls);
        Ok(good_urls)
    }
pub async fn connectivity ( & self , target_urls : & [ String ] ) -> Result < Vec < String > > { log :: trace ! ( " " target_urls ) ; let mut good_urls = vec ! [ ] ; for target_url in target_urls { let url = FeroxUrl :: from_string ( target_url , self . handles . clone ( ) ) ; let request = skip_fail ! ( url format ( " " None ) ) ; let result = logged_request ( & request , self . handles . clone ( ) ) . await ; match result { Ok ( _ ) => { good_urls . push ( target_url . to_owned ( ) ) ; } Err ( e ) => { if matches ! ( self handles config output_level OutputLevel Default OutputLevel Quiet ) { if e . to_string ( ) . contains ( " " ) { ferox_print ( & format ! ( " " target_url ) , & PROGRESS_PRINTER , ) ; } else { ferox_print ( & format ! ( " " target_url ) , & PROGRESS_PRINTER , ) ; } } log :: warn ! ( " " e ) ; } } } if good_urls . is_empty ( ) { bail ! ( " " ) ; } log :: trace ! ( " " good_urls ) ; Ok ( good_urls ) }
Simply tries to connect to all given sites before starting to scan
In the event that no sites can be reached, the program will exit.
Simply tries to connect to all given sites before starting to scan In the event that no sites can be reached the program will exit .
&self
target_urls
&[String]