From 4d4a09addc169a487e7cae4e7aba8d8dd0cd7f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Sat, 21 Jun 2025 16:23:18 -0300 Subject: [PATCH] feat: add HTTP client-server example --- examples/httpClientServer.json | 221 +++++++++++++++++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 examples/httpClientServer.json diff --git a/examples/httpClientServer.json b/examples/httpClientServer.json new file mode 100644 index 00000000..42a00eb4 --- /dev/null +++ b/examples/httpClientServer.json @@ -0,0 +1,221 @@ +{ + "nodes": [ + { + "id": 1, + "type": 0, + "x": 4526.25, + "y": 4781.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:01", + "ip": "10.0.0.1" + } + ], + "tag": "HTTP server", + "mask": "255.255.255.255", + "arpTable": [], + "runningPrograms": [ + { + "pid": 1, + "name": "Serve HTTP requests", + "inputs": [] + } + ] + }, + { + "id": 2, + "type": 1, + "x": 4681.25, + "y": 4855.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:02", + "ip": "10.0.0.2" + }, + { + "name": "eth1", + "mac": "00:00:10:00:00:03", + "ip": "10.0.0.3" + }, + { + "name": "eth2", + "mac": "00:00:10:00:00:04", + "ip": "10.0.0.4" + }, + { + "name": "eth3", + "mac": "00:00:10:00:00:05", + "ip": "10.0.0.5" + } + ], + "tag": null, + "mask": "255.255.255.255", + "arpTable": [], + "routingTable": [ + ["10.0.0.1", "255.255.255.255", 0, false, false], + ["10.0.0.6", "255.255.255.255", 1, false, false], + ["10.0.0.10", "255.255.255.255", 1, false, false], + ["10.0.0.11", "255.255.255.255", 1, false, false] + ], + "packetQueueSize": 4096, + "bytesPerSecond": 1024 + }, + { + "id": 3, + "type": 1, + "x": 4925.25, + "y": 4973.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:06", + "ip": "10.0.0.6" + }, + { + "name": "eth1", + "mac": "00:00:10:00:00:07", + "ip": "10.0.0.7" + }, + { + "name": "eth2", + "mac": "00:00:10:00:00:08", + "ip": "10.0.0.8" + }, + { + "name": "eth3", + "mac": "00:00:10:00:00:09", + "ip": "10.0.0.9" + } + ], + "tag": null, + "mask": "255.255.255.255", + "arpTable": [], + "routingTable": [ + ["10.0.0.1", "255.255.255.255", 0, false, false], + ["10.0.0.3", "255.255.255.255", 0, false, false], + ["10.0.0.10", "255.255.255.255", 1, false, false], + ["10.0.0.11", "255.255.255.255", 2, false, false] + ], + "packetQueueSize": 4096, + "bytesPerSecond": 1024 + }, + { + "id": 4, + "type": 0, + "x": 5082.25, + "y": 4960.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:0a", + "ip": "10.0.0.10" + } + ], + "tag": "Client A", + "mask": "255.255.255.255", + "arpTable": [], + "runningPrograms": [] + }, + { + "id": 5, + "type": 0, + "x": 4969.25, + "y": 5128.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:0b", + "ip": "10.0.0.11" + } + ], + "tag": "Client B", + "mask": "255.255.255.255", + "arpTable": [], + "runningPrograms": [] + } + ], + "edges": [ + { + "from": { + "id": 2, + "iface": 0 + }, + "to": { + "id": 1, + "iface": 0 + } + }, + { + "from": { + "id": 2, + "iface": 0 + }, + "to": { + "id": 1, + "iface": 0 + } + }, + { + "from": { + "id": 3, + "iface": 0 + }, + "to": { + "id": 2, + "iface": 1 + } + }, + { + "from": { + "id": 3, + "iface": 0 + }, + "to": { + "id": 2, + "iface": 1 + } + }, + { + "from": { + "id": 4, + "iface": 0 + }, + "to": { + "id": 3, + "iface": 1 + } + }, + { + "from": { + "id": 5, + "iface": 0 + }, + "to": { + "id": 3, + "iface": 2 + } + }, + { + "from": { + "id": 4, + "iface": 0 + }, + "to": { + "id": 3, + "iface": 1 + } + }, + { + "from": { + "id": 5, + "iface": 0 + }, + "to": { + "id": 3, + "iface": 2 + } + } + ] +}