sim-web: generic peer-proxy + visualiser chatbot start/stop panel - #12
Merged
Conversation
Adds a small reverse proxy at /api/peer/<name>/<path> that resolves <name> via Docker DNS (i.e., a container with that name on the same Docker network) and forwards the request. Hostnames are allowlisted to avoid SSRF surface; today the only entry is "chatbot" → port 8090, the chat-traffic generator deployed alongside the test net. Visualiser gains a CHATBOT HUD panel with START / STOP / status. The panel polls /api/peer/chatbot/state every 4 s; a 503 (unreachable, no such peer) hides the panel quietly. So deployments without a chatbot service show no UI clutter. Together with the test-net chatbot's HTTP control plane (default state STOPPED, /start /stop endpoints), this gives operators a button on the map to turn synthetic chat traffic on and off without docker exec. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The test-net chatbot (synthetic chat-traffic generator) grew a small HTTP control plane (POST /start, POST /stop, GET /state) with STOPPED-as-default. To drive it from the visualiser, sim-web needs to forward HTTP requests into the Docker network where the chatbot lives.
Adds a small allowlisted reverse proxy at
/api/peer/<name>/<path>that resolves<name>via Docker DNS and forwards the request. Today the only entry in the allowlist ischatbot → 8090; new peer services land by adding an entry. 503 on unreachable so the browser can distinguish "no peer deployed" from "peer broken."Visualiser side: new CHATBOT HUD panel with START / STOP / status. Polls /api/peer/chatbot/state every 4 s; hides itself silently on 503. Deployments without a chatbot peer see no UI clutter.
Verified end-to-end against the M0LTE/test-net deployment.
🤖 Generated with Claude Code