iso8583sim serveruns a mock issuer host that answers by rules.iso8583sim sendsends one message and shows the response.iso8583sim loadsends many requests and reports throughput and latency.ISO8583ClientandMockHostdo the same from Python (asyncio).
Quick start
In one terminal, start a mock host:Framing options
All three commands take the same options, and both ends must agree on them:
The length in the header covers everything after it, including the TPDU. On responses, the mock host swaps the TPDU’s destination and source addresses.
Mock host rules
Without a rules file, the mock host approves everything. A rules file lists rules in order; the first rule that matches a request decides the response.
Actions:
respond (default, with respond as the field 39 code), drop (no answer) or close (close the connection). delay_ms delays any action.
Responses echo the request’s matching fields (PAN, processing code, amount, times, STAN, IDs, currency, field 70), set field 39, and add an approval code in field 38 for approved authorizations and financial requests. Rules files can be JSON or YAML (YAML needs pip install pyyaml).
Press Ctrl+C (or send SIGTERM) to stop; the host prints a summary of what it received and how it answered.
Python API
run_load runs a load test from Python and returns a LoadReport with counts, response codes and latency percentiles.
From an AI assistant
The MCP server has asend_to_host tool. To stop an assistant from being used to reach arbitrary machines, it only connects to hosts listed in the ISO8583SIM_ALLOWED_HOSTS environment variable of the MCP server. The default is this machine only (127.0.0.1,localhost,::1). Entries can be a host (any port) or host:port:
Performance
On an Apple M4 Pro, the client and mock host in one process handle about 12,000 round trips per second; with the host in a separate process, a load run reached about 20,000. Seebenchmarks/BASELINE.md and benchmarks/bench_network.py.