Package 'litportFreeProxy'

Title: Client for the Litport Free Proxy Snapshot API
Description: Fetches and validates snapshots of verified HTTP, SOCKS4, and SOCKS5 proxies from the Litport free proxy API. Filters results by protocol, country, anonymity, HTTPS support, latency, uptime, and freshness, returning a normalized data frame. Validation rejects private and reserved IPv4 ranges, malformed timestamps, and truncated or stale snapshots.
Authors: Litport [aut, cre]
Maintainer: Litport <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-10-10 01:27:08 UTC
Source: https://github.com/litportnet/free-proxy-sdk

Help Index


litportFreeProxy: Client for the Litport Free Proxy Snapshot API

Description

Fetches and validates snapshots of verified HTTP, SOCKS4, and SOCKS5 proxies from the Litport free proxy API. Filters results by protocol, country, anonymity, HTTPS support, latency, uptime, and freshness, returning a normalized data frame. Validation rejects private and reserved IPv4 ranges, malformed timestamps, and truncated or stale snapshots.

Details

Create a client with litport_client, then fetch proxies with get_proxies or pick_best. Both functions validate the snapshot envelope and every proxy row, raising conditions of class litport_error (with a more specific subclass such as litport_http_error or litport_snapshot_validation_error) on failure.

See Also

litport_client, get_proxies, pick_best

https://litport.net/free-proxy

https://litport.net/docs/free-proxy-api


Fetch and Filter Litport Free Proxies

Description

Fetches the Litport free proxy snapshot, validates it, and returns the matching proxy records as a normalized data frame ordered by seven-day uptime, then latency, then URL.

Usage

get_proxies(client, ...)

Arguments

client

A "litport_client" object created by litport_client.

...

Named filters. Supported names are protocol (one of "http", "socks4", "socks5"), country (a two-letter code), anonymity (one of "transparent", "anonymous", "elite", "unknown"), https (logical), max_latency_ms, min_uptime_7d, min_checks_7d, and limit (each a non-negative integer), and checked_within_min (an integer from 1 to 1440, default 30). Unrecognized names raise litport_filter_validation_error.

Details

The snapshot envelope and every proxy row are validated before filtering. Invalid envelopes raise litport_snapshot_validation_error; a truncated snapshot raises litport_snapshot_truncated_error; an HTTP status outside 200-299 raises litport_http_error (carrying a status element); a transport timeout raises litport_timeout_error; any other transport failure, such as a name-resolution or TLS error, raises litport_transport_error. Proxy host values are validated as public IPv4 addresses, rejecting private and other reserved ranges. A row's uptime_7d is forced to NA whenever it has fewer than 50 checks in the last 7 days. Only rows whose last_checked timestamp falls within checked_within_min minutes of the current time (and no more than 5 seconds in the future) are kept. Results are sorted with non-missing uptime_7d first (descending), then non-missing latency_ms first (ascending), then url (ascending), before limit is applied.

Value

A data.frame with one row per matching proxy and the columns protocol, ip, port, url, country, region, city, timezone, asn, asn_org, anonymity, https, latency_ms, latency_median_ms, uptime_24h, uptime_7d, checks_7d, exit_ip, sources_count, first_seen, and last_checked (the last two as POSIXct in UTC). When no proxies match, a zero-row data.frame with the same columns and column types is returned rather than NULL.

See Also

litport_client, pick_best

https://litport.net/free-proxy

https://litport.net/docs/free-proxy-api

Examples

client <- litport_client()

## Not run: 
proxies <- get_proxies(client, protocol = "socks5", country = "us",
  limit = 5)
proxies$url

## End(Not run)

Create a Litport Free Proxy Client

Description

Creates a client object holding the snapshot endpoint, request timeout, and optional transport and clock overrides used by get_proxies and pick_best. No network request is made here.

Usage

litport_client(api_url = NULL, timeout = 10, transport = NULL, now = NULL)

Arguments

api_url

Character string giving the snapshot endpoint URL. Defaults to the public Litport free proxy snapshot API.

timeout

Positive, finite number of seconds to wait for the snapshot request before raising a litport_timeout_error. Defaults to 10.

transport

Optional function with signature function(url, timeout) returning list(status, headers, body), where status is an integer HTTP status code, headers is a named character vector, and body is a character string of JSON. Used to inject a deterministic transport for testing; when NULL the client performs a real HTTP GET request using the curl package.

now

Optional zero-argument function returning the current time as a POSIXct in UTC. Used to make freshness and envelope validation deterministic for testing; defaults to the system clock.

Details

The client itself performs no network I/O; it only stores configuration that is used later by get_proxies. Constructing a client raises a condition of class litport_filter_validation_error if timeout is not a positive, finite number, or if transport or now are supplied but are not functions.

Value

An object of class "litport_client": a list holding the validated api_url, timeout, transport, and now settings. Pass it to get_proxies or pick_best.

See Also

get_proxies, pick_best

https://litport.net/free-proxy

https://litport.net/docs/free-proxy-api

Examples

client <- litport_client()

## Not run: 
proxies <- get_proxies(client, protocol = "socks5", country = "us")

## End(Not run)

Fetch the Best Litport Free Proxies

Description

Fetches the Litport free proxy snapshot and returns at most count of the highest-ranked matching proxy records, applying the same filters and ordering as get_proxies.

Usage

pick_best(client, count, ...)

Arguments

client

A "litport_client" object created by litport_client.

count

Non-negative integer giving the maximum number of rows to return.

...

Named filters passed through to get_proxies; see its documentation for the supported names.

Details

pick_best is equivalent to calling get_proxies with the same filters and then taking the first count rows, since get_proxies already returns results sorted best-first. It raises litport_filter_validation_error if count is not a non-negative integer.

Value

A data.frame with the same columns as get_proxies, containing at most count rows taken from the front of the sorted, filtered result. When no proxies match, a zero-row data.frame with the same columns and column types is returned rather than NULL.

See Also

litport_client, get_proxies

https://litport.net/free-proxy

https://litport.net/docs/free-proxy-api

Examples

client <- litport_client()

## Not run: 
best <- pick_best(client, 5, protocol = "http")
best$url

## End(Not run)