Sign inSign up

mojihub/rony

By mojihub

•Updated 6 days ago

TCP, TLS and UDP mock server from a JSON file: serve, record and replay, for tests and local dev.

Image
Networking
Integration & delivery
Developer tools
0

153

mojihub/rony repository overview

⁠rony

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.

⁠Quick start

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.

⁠What it does

  • Serve a configuration file: exact, regular expression and JSON matching, greetings, sequences, delays, disconnects, resets and scenario states.
  • Record and replay: record relays traffic to a real server and saves it; replay serves the recording.
  • Check what it received: --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.
  • Reload on change: --watch reloads the rules when the file changes, without dropping connections.
  • Validate: validate <file> checks a configuration without starting anything.

⁠Docker Compose

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

⁠Tags and platforms

  • 1.5.0, 1.5, 1, latest
  • linux/amd64 and linux/arm64
  • Also published as ghcr.io/archofthings/rony

⁠Security

The 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.

Tag summary

Content type

Image

Digest

sha256:976483924…

Size

79.4 MB

Last updated

6 days ago

docker pull mojihub/rony