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.
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
Using Docker (Recommended)
# 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
- Installation - Docker, binary, and build from source
- Quick Start - Create your first imposter
- Node.js Integration - npm package for Node.js projects
- Migration from Mountebank - Switch from Mountebank to Rift
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
- Mountebank Format - JSON configuration reference
- Native Rift Format - YAML configuration for advanced features
- CLI Reference - Command-line options
Features
- Fault Injection - Latency and error simulation
- Scripting - Rhai, Lua, and JavaScript engines
- TLS/HTTPS - Secure connections
- Metrics - Prometheus integration
Deployment
- Docker - Container deployment
- Kubernetes - K8s deployment patterns
Reference
- REST API - Admin API reference
- Performance - Benchmark results
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.