# Puffing Billy

> A rewriting web proxy for testing interactions between your browser and external sites

Source: https://talira.ai/catalog/puffing-billy-8zjsmm9w
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / testing / http mocking](https://talira.ai/categories/developer-tools/testing/http-mocking), [languages / ruby](https://talira.ai/categories/languages/ruby)
- Licence: MIT[^2]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Self-hostable: yes[^3]
- API: yes[^1]
- Creator: Olly Smith (oesmith)

Puffing Billy is like [WebMock](https://talira.ai/catalog/webmock-ey6nmggt.md) or [VCR](https://talira.ai/catalog/vcr-5q5vt0wn.md), but for the browser: it runs an EventMachine-based proxy that the test browser sends its requests through, so feature specs can stub what external sites return, including HTTPS, redirects, error codes and dynamic responses from a Proc. It can also pass requests through and change them, and cache and replay real responses to disk. It has setups for [Capybara](https://talira.ai/catalog/capybara-s6z3hhxe.md) ([Selenium](https://talira.ai/catalog/selenium-dran12kh.md), Cuprite and other drivers), Watir, [RSpec](https://talira.ai/catalog/rspec-87n8pes2.md), Minitest and Cucumber.

## Links

- GitHub: https://github.com/oesmith/puffing-billy

## Problems it solves

- my Capybara feature specs break when a third-party API the page calls from JavaScript is down
- stub the HTTP requests the browser makes during feature tests, not only the Ruby server's
- test how my page behaves when an external widget's API starts returning 500s
- record the browser's requests to outside sites once and replay them in later test runs
- fake what Google, Twitter or another embedded script returns to the browser in tests
- block every external request the test browser makes except the hosts I allow
- stub HTTPS requests made by headless Chrome in an integration test
- return JSON or JSONP from a fake endpoint in a JavaScript-heavy browser test
- make browser integration tests repeatable when the page depends on outside services
- intercept and change a real upstream response before the test browser sees it

## Features

- stub responses by URL and method: text, JSON, JSONP, redirects and status codes
- HTTPS stubbing
- dynamic responses from a Proc
- pass-through requests that can change the request and the upstream response
- response cache with persistence, record and replay
- host whitelists and an option to block non-whitelisted requests
- Capybara drivers for Selenium (Firefox and Chrome, headless), Cuprite, Apparition and others
- Watir, RSpec, Minitest and Cucumber setups

## Limitations

- Doesn't proxy WebSockets: ActionCable and other WebSocket connections have to bypass it[^1]

## Capabilities

- Has an API: plan not known

## Trust

Overall: 0.28 out of 1.
Signals: backing 0.20, extensibility 0.20.

- created by Olly Smith (oesmith)

Warnings:

- GitHub activity not fetched yet

## Alternatives

- [WebMock](https://talira.ai/catalog/webmock-ey6nmggt.md): Library for stubbing and setting expectations on HTTP requests in Ruby.
- [VCR](https://talira.ai/catalog/vcr-5q5vt0wn.md): Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.

## Sources

[^1]: https://github.com/oesmith/puffing-billy#readme (checked 20 Nov 2026)
[^2]: https://github.com/oesmith/puffing-billy/blob/master/LICENSE (checked 20 Nov 2026)
[^3]: https://github.com/oesmith/puffing-billy (checked 20 Nov 2026)
