← Back to all sparks
W

webfakes

INFRA · APIS
Velocity0.0

Fake web apps for HTTP testing R packages. Contribute to r-lib/webfakes development by creating an account on GitHub.

A fake web server for tests that keeps closing the gap with the real thing.

testinghttp-serverr-packagetest-fixtureshttps
Current state
webfakes runs a real HTTP server inside R tests so packages can exercise network code without hitting the internet. Its releases follow a consistent logic: find a class of behaviour that only the real internet could reproduce, then implement it locally. HTTPS arrived in 1.4.0; before that the httpbin clone reached full parity with the Python original, and a fake git HTTP server landed alongside CGI middleware. The most recent release, 1.5.0, is about the server's own rough edges — keep-alive timeouts, locale-independent HTTP date parsing, and trailing-slash route matching.
Where it's heading
The package is converging on being indistinguishable from a real server for test purposes, which is the only way it stays useful — every unsupported protocol feature is a piece of code someone cannot test offline. The remaining work has visibly shifted from missing endpoints to correctness details: date header parsing under unusual locales, keep-alive tuning, request body handling across content types.
Prediction
Expect continued fidelity work against real-server behaviour rather than new app types, with HTTP/2 or authentication schemes the most plausible next gaps given the direction HTTPS opened. The entries do not indicate a specific planned feature.

Recent moves

  1. 2mo ago

    Keep-alive tuning, locale-safe HTTP dates, looser routes

    A fidelity release rather than a feature one: the keep-alive idle timeout becomes configurable and defaults ten times higher than CivetWeb's, HTTP date headers parse correctly regardless of LC_TIME, and route matching now ignores trailing slashes. The httpbin app also returns request bodies for any content type, matching httpbin.org more closely.

    View source ↗
  2. 1y ago

    HTTPS support lands in the fake server

    ⚡ SPARK

    The single largest expansion of what this package can stand in for: TLS code paths were previously untestable offline, and now they are not. It fits the package's long arc of absorbing behaviour that previously required a real server.

    View source ↗
  3. 1y ago

    New decode_url server option

    A single server option to disable URL decoding, useful for testing clients that send unusual paths. Narrow but consistent with the package's habit of exposing whatever knob a test author turns out to need.

    View source ↗
  4. 2y ago

    Adds a fake git HTTP server and CGI middleware

    git_app() lets packages test git-over-HTTP interactions locally, built on new mw_cgi() middleware that can invoke CGI scripts. Extending beyond generic HTTP into a specific protocol is a notable widening of what the package can simulate.

    View source ↗
  5. 2y ago

    Fixes tmpl_glue() on affected macOS builds

    A workaround for an upstream R bug in readChar() that broke template rendering on macOS 14. No behaviour change beyond restoring what already worked elsewhere.

    View source ↗
  6. 3y ago

    httpbin clone reaches parity with the Python original

    The httpbin app implements its last missing endpoints — compression, digest auth, ranges, streaming, caching and cookies — reaching full parity with the Python httpbin. Cookie parsing middleware and Range header parsing arrive at the same time, making the package a drop-in replacement for tests that previously pointed at httpbin.org.

    View source ↗