hoverfly is a Go proxy whose middleware feature needs Ruby or Python
Lightweight service virtualization/ API simulation / API mocking tool for developers and testers
At a glance
- What is it?
- An Apache-2.0 API simulation tool written in Go, with a vendored dependency tree containing three forks maintained by its own organisation and two duplicate-purpose libraries. Its build produces two binaries but the container image ships only one, the final image copies its certificate bundle instead of installing it, and the documented test prerequisites include a Ruby and a Python runtime.
- Who is it for?
- hoverfly is a sound choice if your test suite keeps failing on third-party API dependencies, since replacing those with recorded simulations is exactly the problem it addresses, and injecting latency, random failures and rate limits is the part most mock libraries do not do at all. Four things to weigh.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository received new commits within the last day.
- What is it written in?
- Mainly Go, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.
Star history
- SpectoLabs/hoverfly2,534 ★ · +9
| Repository | 2026-09-30 | 2026-11-22 |
|---|---|---|
| SpectoLabs/hoverfly | 2.5k | 2.5k |
9 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The scripting layer is not Go
The most surprising line in the build instructions is this one: some middleware tests may fail if you do not have `ruby` and `python` set up in your environment.
Not tests for a third-party client. Tests for a feature of the tool itself, and the fix offered is to install both runtimes, with Homebrew commands given for a Mac.
That tells you what middleware is. The examples directory has a folder named for it, alongside folders for clients, simulations, journal templating, and post-serve actions. Middleware is the extension point where a simulation can run real code, and that code is executed by an external Ruby or Python interpreter rather than compiled into the Go binary.
So the claim on the feature list, that you can extend and customize with any programming language, is accurate and also hides a dependency. The marketing line about being lightweight and running anywhere is a property of the binary. The property of the tool as a whole includes whatever interpreters your middleware scripts need, on whatever machine runs the tests.
That is not a criticism so much as a thing to plan for. If your team already has Ruby or Python in CI, the cost is near zero. If your pipeline is a minimal Go container, the middleware tests are the part that will not run.
Two binaries are built and only one reaches the container
The Makefile produces two executables into a `target` directory: `hoverfly`, which is the proxy server, and `hoverctl`, which is the command line client.
The Docker image contains exactly one of them. The final stage copies a single file, the statically linked hoverfly binary, into `/bin`, and sets the entry point to that binary. Nothing copies hoverctl.
So a container built from this repository is a server with no client for it. That is a defensible split, since the server image stays smaller and the CLI is easier to install separately, but it is not stated anywhere and it will surprise the first person who tries to run `hoverctl` inside the container.
The CLI also carries a version, and how it gets there is worth knowing. Its build step passes a linker flag that sets the version string from a Make variable named `GIT_TAG_NAME`. That variable is not derived inside the Makefile, so it has to be supplied by whoever runs the build. Build hoverctl without it and the binary reports an empty version, which is a confusing thing to hit when you are trying to work out whether a rollout actually updated.
The server binary takes no such flag. Its build is a plain `go build` with an output path.
Two build targets and one ordering trap
The Makefile has two ways to build the server and they are not equivalent.
`make build` compiles both binaries directly and runs no tests. The individual targets are gated: the server build target depends on the server unit tests, and the client build target depends on the client unit tests. So the same binary can be produced with or without a test run depending on which target you invoke, and the top-level convenience target is the one that skips them.
`make test` composes four things: the vet step, the server functional tests, the client unit tests, and the client functional tests.
The server unit tests are in there without appearing in the list. They arrive transitively, because the server functional test target depends on the server build target, which depends on the server unit tests. That is a workable arrangement and an invisible one, since nothing in the test target names them.
The ordering trap is in the client functional tests. That target copies the freshly built `hoverfly` binary into the test directory before running, but unlike the server functional test target, it does not depend on the build that produces it. Invoke it on a clean checkout and it will try to copy a file that is not there.
Both functional test targets also stage the binary into a `bin` directory inside the test tree, which is why the build output directory and the test directory have to be kept in step.
The final image copies its certificates instead of installing them
The container build is two stages and the second one does something unusual.
The first stage is a Go toolchain image matching the module's own version, and the build runs with cgo disabled, which produces a static binary. It honours the target operating system and architecture arguments so the same Dockerfile works under a multi-architecture build tool.
The second stage is Alpine, and the comment on it explains the design: it is a minimal image based on Alpine, without running the package manager, to avoid triggering QEMU issues during a cross-architecture build.
That constraint shapes two decisions. The certificate bundle is copied straight out of the builder stage rather than installed, with a note that the PEM bundle is architecture independent, so one copy works for every target. And no packages are installed at all, which is why the runtime image contains the binary and a certificate file and nothing else.
The practical effect is a very small runtime image and a build that never runs a package manager, at the cost of the image being pinned to whatever the base tag happens to contain. There is no shell in that image either, so anything you would normally do by exec-ing into the container to debug is not available.
The Dockerfile sits at the repository root, and the build is driven by a separate shell script at the root for releases.
The entry point listens on every interface
One line in the Dockerfile deserves to be read on its own:
ENTRYPOINT ["/bin/hoverfly", "-listen-on-host=0.0.0.0"]The default bind address in the image is every interface, and two ports are exposed, 8500 and 8888.
For a proxy that sits between your application and the services it calls, binding widely is often what you want inside a container network, and it is the usual default for this kind of image. It is also the kind of default that becomes a problem the moment the port is published to a host, because the two exposed ports are then reachable from wherever the host is.
There is no authentication described anywhere in the container configuration, and no indication that the server refuses to start on a non-loopback address without a flag. The address is passed as a command-line argument in the entry point, which means overriding it is a matter of replacing the entry point arguments rather than setting an environment variable.
So the practical advice is narrow: if you publish these ports, pass an explicit loopback or a specific address, and check what the administration interface on the second port actually exposes before you route traffic to it.
Vendored dependencies with three forks and several duplicates
The repository commits a vendor directory, and every package listing in the Makefile filters it out explicitly with a pattern excluding `vendor`. That is a deliberate arrangement for a tool people build from source, and it means the dependency tree is part of the repository rather than resolved at build time.
Inside that tree, three dependencies are forks maintained by the same organisation that maintains the project: a proxy library and its extension package, an XML to JSON converter, and a template engine, the last pinned with an incompatible version suffix. Those forks exist for a reason the README does not explain, and they are the first place to look if you are extending the proxy behaviour.
Then there is the ordinary drift of a project with a long history. A key-value store dependency is at a release that predates its own successor. A logging middleware dependency is the pre-rename version of what became a different router. Two separate fake-data generators are present, and so are two validation libraries, one schema-driven and one tag-driven. The test framework pair is a generation one runner with a much newer assertion library. A JWT library is two major versions behind its current one.
One line is more telling than any of those: the target for updating dependencies still calls `godep`, a tool that predates modules entirely, in a project that has a module file and a vendor directory.
The docs badge is plain HTTP and the interface comes from elsewhere
Three small things about where the documentation and the web interface actually come from.
The first is the badge. The documentation link in the header is a Read the Docs badge pointing at `http://hoverfly.readthedocs.io/en/latest/?badge=latest`, over plain HTTP rather than HTTPS. The site it resolves to is the same one the quick start sends you to, so the redirect to HTTPS happens after the request rather than before it.
The second is that the documentation is built from a directory in the repository with its own Makefile and a `make clean html` target, while being published by Read the Docs through a configuration file at the root. So the same content is built in two ways depending on whether you are a contributor or a reader.
The third is the web interface. It is not in this repository. There is a build target that installs a static asset embedding tool, downloads a release archive from a separate interface repository for the given tag, unpacks it into a directory, embeds it, and then deletes both the archive and the directory it unpacked into. The download is done with a plain fetch command, so a build depends on that other project's release existing for the tag you are building.
Version bumps are handled the same way, by patching a source file with a line-oriented text tool rather than by a release tool reading metadata.
Editorial conclusion
hoverfly is a sound choice if your test suite keeps failing on third-party API dependencies, since replacing those with recorded simulations is exactly the problem it addresses, and injecting latency, random failures and rate limits is the part most mock libraries do not do at all. Four things to weigh. The middleware feature is not Go, so if you plan to script behaviour in it you are committing to a Ruby or Python runtime on machines that have only the static binary today. The Docker image contains the server alone, not the CLI, so your containerised tooling has to invoke the REST API instead of hoverctl. The image entry point listens on every interface by default, so decide deliberately whether that is what you want before exposing it. And the dependency tree is vendored with several libraries that show their age, so plan for upgrade work rather than assuming a clean dependency graph. Pin a release; the tags move regularly.
Frequently asked questions
what is hoverfly testing
Hoverfly is an API simulation tool that replaces slow or flaky API dependencies with reusable simulations, so tests run against recorded or generated behaviour instead of live services. It can also inject network latency, random failures, and rate limits to exercise edge cases.
What is Hoverfly written in and how do I build it?
Go. Install Go from the official site, clone the repository, then run `make build`, which writes binaries into the `target` directory. The module file requires Go 1.27.1.
Which binaries does Hoverfly produce?
Two: `hoverfly`, the proxy server, and `hoverctl`, the command line client. The Docker image copies only the server into the final image, so a container built from this repository has no CLI in it.
Why do some Hoverfly tests need Ruby and Python?
Because the middleware feature is implemented in those languages rather than in the Go binary. The README says some middleware tests may fail if ruby and python are not set up, and suggests installing both with Homebrew on a Mac.
Which ports does the Hoverfly container expose?
It exposes 8500 and 8888, and its entry point runs the server with `-listen-on-host=0.0.0.0`, so it listens on every interface by default. No authentication is described in the container configuration.
How does Hoverfly build its web interface?
A build target downloads a release archive from a separate interface repository for the given tag, unpacks it, embeds the assets with a static asset tool, and then deletes both the archive and the unpacked directory.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/spectolabs-hoverfly)Star history chart for your README
[](https://hysenlabs.com/projects/spectolabs-hoverfly)Was this useful?