Skip to main content

Module proxy

Module proxy 

Source
Expand description

Shared proxy / HTTP utilities.

ProxyMode, ProxyConnector, and the low-level get / post helpers are defined here once and re-exported to every scraper module. This eliminates the four near-identical copies that existed before.

Structs§

ProxyConnector
A hyper Connector that always dials a fixed upstream proxy host:port, regardless of the target URI. The real target URI is carried in the Host header (HTTP/1.1 CONNECT-less plain-HTTP proxy protocol).

Enums§

ProxyMode
How to route outbound HTTP requests.

Constants§

USER_AGENT
Use a realistic browser UA everywhere so the target server does not reject requests. (Previously room_list.rs used a different string, causing inconsistent behaviour.)

Functions§

extract_jsessionid
Extract JSESSIONID from a header map’s Set-Cookie values.
resolve_url
Resolve location (possibly relative) against base.
send_follow_redirects
Follow up to MAX_REDIRECTS HTTP 3xx responses automatically.
send_once
Send a single GET request and return (status, headers, body).
url_encode
Percent-encode a string for use as a query parameter value. Uses percent-encoding crate with NON_ALPHANUMERIC set (safe for all values).

Type Aliases§

BoxError