Skip to main content

Module http

Module http 

Source
Expand description

HTTP scraping adapter with anti-bot capabilities HTTP scraping adapter with anti-bot features

Implements the ScrapingService port using reqwest with:

  • Realistic browser headers and User-Agent rotation
  • Cookie jar persistence across requests in a session
  • Exponential backoff retry (up to 3 attempts)
  • Configurable timeouts
  • Optional proxy support
  • T112 catalogue-fingerprint rejection (default-on): outbound User-Agents are matched against a deny-list of known library banners (requests, urllib3, httpx, Scrapy, axios, node-fetch, curl <8.4). A catalogue hit is rejected before hitting the wire unless the caller opts in via HttpConfig::allow_plain_http. This is the safe default — see the module-level docs for HttpAdapterError::PlainJa4Rejected.

§Example

use stygian_graph::adapters::http::{HttpAdapter, HttpConfig};
use stygian_graph::ports::{ScrapingService, ServiceInput};
use serde_json::json;

let adapter = HttpAdapter::with_config(HttpConfig::default());
let input = ServiceInput {
    url: "https://httpbin.org/get".to_string(),
    params: json!({}),
};
// let result = adapter.execute(input).await.unwrap();

Structs§

HttpAdapter
HTTP client adapter with anti-bot features.
HttpConfig
Configuration for the HTTP adapter

Enums§

CatalogueFingerprint
Known catalogue fingerprints that HttpAdapter refuses to send by default.
HttpAdapterError
Errors specific to catalogue-rejection (T112).
StealthProfile
Stealth-profile reference — a named UA/TLS bundle.