TCP, TLS and UDP mock server from a JSON file: serve, record and replay, for tests and local dev.
153
rony is the command-line tool of Rony.Net: a mock server for raw TCP, TLS, UDP and Unix sockets, described in a JSON file. Use it as a stand-in for a real service during local development, in CI, or next to your application in Docker Compose. No .NET is needed on the machine.
Save this as mocks/mock.json:
{ "version": 1, "rules": [ { "request": "PING", "reply": "PONG" } ] }
Run it:
docker run --rm -p 127.0.0.1:4000:4000 -v "$PWD/mocks:/config:ro" mojihub/rony run /config/mock.json --port 4000 --address 0.0.0.0
The server must listen on 0.0.0.0 inside the container, either through --address or in the file. Without arguments the image runs /config/mock.json.
record relays traffic to a real server and saves it; replay serves the recording.--journal <file> writes every request as one JSON line, and --control <port> opens a control endpoint to list requests, clear them, and read or set the scenario state.--watch reloads the rules when the file changes, without dropping connections.validate <file> checks a configuration without starting anything.services:
shop-mock:
image: mojihub/rony
command: ["run", "/config/shop.json", "--port", "4000", "--address", "0.0.0.0"]
volumes:
- ./mocks:/config:ro
app:
build: .
depends_on:
- shop-mock
environment:
SHOP_ADDRESS: shop-mock:4000
1.5.0, 1.5, 1, latestlinux/amd64 and linux/arm64ghcr.io/archofthings/ronyThe tool is meant for development and test networks. The control endpoint has no authentication; when you publish its port, bind it to 127.0.0.1. The container runs as a non-root user.
Rony.Net.Testcontainers to start this image from a .NET testContent type
Image
Digest
sha256:976483924…
Size
79.4 MB
Last updated
6 days ago
docker pull mojihub/rony