Rift

High-performance Mountebank-compatible HTTP/HTTPS mock server written in Rust

Rift is a drop-in replacement for Mountebank that provides 2-250x better performance while maintaining full API compatibility. Use your existing Mountebank configurations and enjoy faster test execution.

Get Started View on GitHub


Why Rift?

Drop-in Mountebank Replacement

Rift implements the Mountebank REST API, allowing you to:

  • Use existing Mountebank configuration files without changes
  • Keep your current test infrastructure and tooling
  • Switch between Mountebank and Rift transparently

Blazing Fast Performance

Built in Rust with async I/O, Rift delivers exceptional performance:

Feature Mountebank Rift Speedup
Simple stubs 1,900 RPS 39,000 RPS 20x faster
JSONPath predicates 107 RPS 26,500 RPS 247x faster
XPath predicates 169 RPS 28,700 RPS 170x faster
Complex predicates 900 RPS 29,300 RPS 32x faster
High concurrency 1,800 RPS 29,700 RPS 16x faster

Full Feature Compatibility

Rift supports all major Mountebank features:

  • Imposters - HTTP/HTTPS mock servers on any port
  • Stubs - Request matching with responses
  • Predicates - equals, contains, matches, exists, jsonpath, xpath, and, or, not
  • Responses - Static, proxy, injection with behaviors
  • Behaviors - wait, decorate, copy, lookup
  • Recording - Proxy mode with response recording

Quick Start

# Pull the latest image (from GitHub Container Registry)
docker pull ghcr.io/etacassiopeia/rift-proxy:latest

# Or from Docker Hub
docker pull etacassiopeia/rift-proxy:latest

# Run Rift (Mountebank-compatible mode)
docker run -p 2525:2525 ghcr.io/etacassiopeia/rift-proxy:latest

Create Your First Imposter

# Create an imposter that responds to GET /hello
curl -X POST http://localhost:2525/imposters \
  -H "Content-Type: application/json" \
  -d '{
    "port": 4545,
    "protocol": "http",
    "stubs": [{
      "predicates": [{ "equals": { "method": "GET", "path": "/hello" } }],
      "responses": [{ "is": { "statusCode": 200, "body": "Hello, World!" } }]
    }]
  }'

# Test the imposter
curl http://localhost:4545/hello
# Output: Hello, World!

Using an Existing Mountebank Config

# Start Rift with your existing imposters.json file
docker run -p 2525:2525 -v $(pwd)/imposters.json:/imposters.json \
  ghcr.io/etacassiopeia/rift-proxy:latest --configfile /imposters.json

Node.js Integration

For Node.js projects, use the official npm package:

npm install @rift-vs/rift
import rift from '@rift-vs/rift';

// Start a Rift server (drop-in replacement for Mountebank)
const server = await rift.create({ port: 2525 });

// Create imposters, run your tests...

await server.close();

See the Node.js Integration Guide for complete documentation.


Documentation

Getting Started

Mountebank Compatibility

  • Imposters - Creating and managing mock servers
  • Predicates - Request matching (equals, contains, regex, jsonpath, xpath)
  • Responses - Configuring stub responses
  • Behaviors - Response modification (wait, decorate, copy)
  • Proxy Mode - Recording and replaying responses

Configuration

Features

Deployment

Reference


Project Status

Rift is under active development. Current status:

Feature Status
HTTP Imposters Stable
HTTPS Imposters Stable
All Predicates Stable
Static Responses Stable
Proxy Mode Stable
Behaviors (wait, decorate) Stable
Injection (JavaScript) Stable
TCP Protocol Planned
SMTP Protocol Planned

License

Rift is distributed under the Apache License 2.0.