MockForge
MockForge is a comprehensive mocking framework for APIs, gRPC services, and WebSockets. It provides a unified interface for creating, managing, and deploying mock servers across different protocols.
Features
- Multi-Protocol Support: HTTP REST APIs, gRPC services, and WebSocket connections
- Dynamic Response Generation: Create realistic mock responses with configurable latency and failure rates
- Scenario Management: Define complex interaction scenarios with state management
- CLI Tool: Easy-to-use command-line interface for local development
- Admin UI: Web-based interface for managing mock servers
- Extensible Architecture: Plugin system for custom response generators
Quick Start
Installation
cargo install mockforge-cli
Basic Usage
# Start a mock server with an OpenAPI spec
cargo run -p mockforge-cli -- serve --spec examples/openapi-demo.json --http-port 3000
# Add WebSocket support with replay file
MOCKFORGE_WS_REPLAY_FILE=examples/ws-demo.jsonl cargo run -p mockforge-cli -- serve --ws-port 3001
# Full configuration with Admin UI
MOCKFORGE_WS_REPLAY_FILE=examples/ws-demo.jsonl \
MOCKFORGE_RESPONSE_TEMPLATE_EXPAND=true \
cargo run -p mockforge-cli -- serve --spec examples/openapi-demo.json --admin --admin-port 8080
# Use configuration file
cargo run -p mockforge-cli -- serve --config demo-config.yaml
Docker
docker run -p 3000:3000 -p 3001:3001 -p 50051:50051 SaaSy-Solutions/mockforge
Documentation Structure
- Getting Started - Installation and basic setup
- HTTP Mocking - REST API mocking guide
- gRPC Mocking - gRPC service mocking
- WebSocket Mocking - WebSocket connection mocking
- Configuration - Advanced configuration options
- API Reference - Complete API documentation
- Contributing - How to contribute to MockForge
- FAQ - Frequently asked questions
Examples
Check out the examples/
directory for sample configurations and use cases.
Community
- GitHub Issues - Report bugs and request features
- GitHub Discussions - Ask questions and share ideas
- Discord - Join our community chat
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.