Expand description
Build and validate proxy connection strings.
This crate builds the username a proxy gateway expects, refuses the input that gateway would mishandle, and hands the result to whatever HTTP client you already use. It holds no session and retries nothing.
use nodemaven::Proxy;
let proxy = Proxy::builder()
.login("your-login")
.password("your-password")
.param("country", "us")
.param("filter", "medium")
.build()?;
// reqwest::Proxy::all(proxy.url())?
assert_eq!(proxy.username(), "your-login-country-us-filter-medium");There is no retry policy here on purpose. Retrying a refused request is the one thing that reliably makes the next one worse: measured over 1464 attempts, the chance the next attempt succeeds falls from 75% with no prior failure to 5.8% after five and 0.5% after seven, and 294 attempts spent past six consecutive failures returned three pages - 98 attempts per delivered page against 1.7 in a healthy session. A library that hid that behind a default would be spending a shared pool’s reputation on your behalf.
Structs§
- Browser
Proxy - The proxy fields a browser driver takes, unencoded. See
Proxy::browser. - Check
- What one CONNECT produced.
- Client
- Talks to the account API. One client, one API key.
- Client
Builder - Builds a
Client. - Connect
- One CONNECT, configured but not yet sent.
- Page
- One page of a list endpoint. One page, not the collection - see
Client::iterate. - Pages
- Every row from a page onward, across pages. Yields
Erronce and stops. - Paging
- How one endpoint numbers its pages. This API uses three conventions.
- Provider
- One gateway’s username dialect.
- Provider
Builder - Builds a
Providerby hand, for a gateway with no shipped definition. - Proxy
- A set of gateway parameters plus the credentials to use them.
- Proxy
Builder - Collects the parts of an identity. See
Proxy::builder.
Enums§
- Error
- Everything this crate returns.
Constants§
- API_
ROOT - Every path hangs off this.
- ASCII_
WHITESPACE - The six characters treated as whitespace in a parameter value.
- BY_
OFFSET - The
locations/*endpoints:limit/offsetfrom 0. - BY_
PAGE_ NUMBER sub-users/:page/per_pagefrom 1, no size sent - the document givesper_pageno default and no maximum.- DEFAULT_
API_ TIMEOUT - How long the built-in transport waits for a whole response.
- DEFAULT_
BASE_ URL - The dashboard host the API lives on. Overridden by
NODEMAVEN_BASE_URL. - DEFAULT_
PAGE_ SIZE - Rows asked for per request on the
limit/offsetendpoints: the largest value every one of them accepts.locations/isps/refuses a request with nolimitat all, and the others answer one with 50 rows and no total. - DEFAULT_
PROVIDER - The definition used when a caller names none.
- DEFAULT_
TARGET - What a CONNECT is opened to.
- DEFAULT_
TIMEOUT - How long a
Connectwaits, when nothing says otherwise. - ISP_
CITIES_ PAGING locations/isps/cities/: pages of 100. This endpoint’s time grows with the page - 100 rows in 8.3 s, 1000 in 56.0 s, measured 2026-09-29 - and 1000 did not fit in the default timeout.- WHITELIST_
PAGING whitelist/ips:page/page_sizefrom 1, at the document’s maximum of 100 because its default is 5, and a404past the end.
Traits§
- Transport
- How a request reaches the API:
(method, url, headers, body)in, the status and the raw body out.
Functions§
- available
- Ids of the definitions compiled into this crate.
- load
- A definition shipped with this crate.
- load_
file - A definition read from an arbitrary path.
- load_
file_ as - A definition read from an arbitrary path, under an id you choose.
- load_
str - A definition read from TOML already in memory.
Type Aliases§
- Result
- The result type every fallible call in this crate returns.