Skip to main content

Module session

Module session 

Source
Expand description

Domain-scoped proxy session stickiness.

A sticky session binds a target domain to a specific proxy for a configurable TTL. Requests to the same domain reuse the same proxy, preserving IP consistency for anti-bot fingerprint checks while still rotating across different domains.

§Example

use stygian_proxy::session::{SessionMap, StickyPolicy};
use std::time::Duration;
use uuid::Uuid;

let map = SessionMap::new();
let ttl = Duration::from_secs(300);
let proxy_id = Uuid::new_v4();

map.bind("example.com", proxy_id, ttl);
assert_eq!(map.lookup("example.com"), Some(proxy_id));

Structs§

SessionMap
Thread-safe map of session keys (typically domains) to proxy bindings.

Enums§

StickyPolicy
Policy controlling when and how proxy sessions are pinned to a key.