INNER CODE UNIT · Rust

is_internal_url

keon/browser-control · src/cdp.rs:22

pub fn is_internal_url(url: &str) -> bool {
    INTERNAL.iter().any(|p| url.starts_with(p))
}

pub struct Cdp {
    pub ws: tokio_tungstenite::WebSocketStream<
        tokio_tungstenite::MaybeTlsStream<tokio::net::TcpStream>,
    >,
    id: u64,
    pub session: Option<String>,
    pub target: Option<String>,
}

impl Cdp {
    pub async fn connect() -> Result<Self> {
        let ws_url = ws_url().await?;
        let (ws, _) = tokio::time::timeout(cdp_timeout(), connect_async(&ws_url))
            .await

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…