Balkon OBS Agent is the local desktop bridge between the Balkon backend/relay and the streamer's local OBS Studio instance.
It is part of the Balkon ecosystem:
phenibut645/balkon— Discord bot, backend API, MySQL database, migrations and OBS relayphenibut645/balkon-website— Next.js dashboard and Streamer Studio UIphenibut645/balkon-obs-agent— this repository, local Windows desktop agent for OBS Studio
The agent is intended for streamers. They do not need to clone the main bot/backend repository or install database dependencies. They only run the packaged desktop app, connect it to the relay, and connect it to their local OBS Studio WebSocket server.
OBS Studio runs on the streamer's own PC. The backend and Discord bot usually run on a remote server. Directly exposing a local OBS WebSocket port to the internet would be unsafe and unreliable.
Balkon therefore uses an outbound relay model:
Balkon Website / Discord bot
↓
Balkon backend API / command queue
↓
Balkon OBS relay
↓ outbound WebSocket
Balkon OBS Agent on streamer PC
↓ local WebSocket
OBS Studio ws://127.0.0.1:4455
The agent connects outward to the relay and then controls OBS locally. This avoids router/NAT problems and prevents the public exposure of the OBS WebSocket port.
- Connects to the Balkon OBS relay with Agent ID and Agent Token
- Connects to local OBS Studio through obs-websocket
- Executes OBS commands sent by the backend/relay
- Reports relay and OBS connection status
- Shows recent events/logs in the UI
- Supports English, Russian and Estonian UI languages
- Runs in the Windows system tray
- Supports auto-connect and OBS auto-retry behavior
- Supports packaged Windows releases and GitHub Release auto-updates
- Masks token/password inputs and avoids printing full secrets in logs
npm installnpm run devAuto-update behavior is not active in development mode. It is intended for packaged builds.
npm run buildnpm run distThe packaged installer is written to:
release/
Do not commit generated release artifacts into Git.
Ignored/generated artifacts include:
release/
dist/
win-unpacked/
*.exe
Before using the agent, OBS Studio must have the WebSocket server enabled.
- Open OBS Studio.
- Go to:
Tools -> WebSocket Server Settings
- Enable the WebSocket server.
- Use the default port:
4455
- Set a password if desired, or leave it empty for local testing.
- Keep OBS Studio open while testing agent commands.
Default local OBS WebSocket URL:
ws://127.0.0.1:4455
Credentials are generated from the Balkon system, normally through the website Streamer Studio or Discord streamer commands.
Legacy Discord command flow:
/streamer register nickname:<nickname> primary:true
/streamer agent_pair nickname:<nickname>
The website Streamer Studio can also show/generate the Agent ID and token through OBS Agent setup screens, depending on the current backend/dashboard configuration.
Important:
- Agent Token is sensitive.
- Do not share real Agent Tokens in screenshots or commits.
- In streamer/demo mode, token-like values should be hidden or masked.
Enter these values in Balkon OBS Agent:
| Field | Description |
|---|---|
| Relay URL | WebSocket URL of the Balkon OBS relay |
| Agent ID | Agent identifier generated by Balkon |
| Agent Token | Secret pairing token generated by Balkon |
| OBS WebSocket URL | Local OBS WebSocket URL, usually ws://127.0.0.1:4455 |
| OBS WebSocket Password | Optional OBS WebSocket password |
Production relay example:
wss://venomancer.aleksandermilisenko23.thkit.ee/
Local OBS example:
ws://127.0.0.1:4455
After filling values:
- Click Save.
- Click Connect.
- Use Test OBS to check local OBS connectivity.
agent starts
→ loads saved config
→ connects to Balkon relay
→ sends hello with agentId and agentToken
→ relay validates credentials
→ relay accepts connection
→ agent status becomes online
backend queues/sends OBS command
→ relay forwards command to connected agent
→ agent executes command against local OBS WebSocket
→ agent returns command result
→ backend/dashboard can display success or failure
Common command categories:
- get OBS status
- list scenes
- switch scene
- list scene items/sources
- set source visibility
- update text source
- trigger media input action
- show configured OBS media/effects
The agent has a tabbed UI.
| Tab | Purpose |
|---|---|
| Main | Connection settings, relay/OBS status and recent event log |
| Settings | Behavior options, language selection and update controls |
| Changelog | Release history and notable changes |
- English
- Русский
- Eesti
Language selection is saved locally and applied without requiring an app restart.
Balkon OBS Agent is designed to run as a tray application.
| Action | Result |
|---|---|
| Close window | Hide to tray, agent keeps running |
| Quit from tray | Fully exit and disconnect |
| Item | Action |
|---|---|
| Open | Show the main window |
| Connect | Connect to the relay using saved config |
| Disconnect | Disconnect from relay |
| Check for Updates | Check GitHub Releases for a new version |
| Quit | Disconnect and exit |
| Setting | Description |
|---|---|
| Start with Windows | Register app as a login item so it starts with Windows |
| Start minimized to tray | Start hidden in the system tray |
| Auto-connect on launch | Connect to relay automatically if credentials are saved |
| Auto-retry OBS connection | Retry local OBS connection every few seconds when OBS is not available |
Auto-retry logs only the first retry attempt to avoid log spam.
Use this checklist after changing relay, OBS or packaging behavior.
[ ] npm install completed
[ ] npm run build passes
[ ] npm run dev starts the app
[ ] OBS WebSocket is enabled in OBS Studio
[ ] Relay URL is saved
[ ] Agent ID and Agent Token are saved
[ ] OBS WebSocket URL is saved
[ ] Connect succeeds
[ ] Test OBS succeeds
[ ] Agent appears online in Balkon/Streamer Studio
[ ] OBS scenes can be listed from website or bot
[ ] OBS scene switching works
[ ] OBS source visibility update works
[ ] Media/effect command works if configured
[ ] Closing window hides to tray
[ ] Quit fully exits the app
Balkon OBS Agent uses GitHub Releases for auto-updates.
npm version patch --no-git-tag-version
npm run dist
git add .
git commit -m "chore: release v0.1.X"
git pushThen create a GitHub Release:
Tag: v0.1.X
Title: Balkon OBS Agent v0.1.X
Upload these files from release/:
Balkon-OBS-Agent-Setup-0.1.X.exe
Balkon-OBS-Agent-Setup-0.1.X.exe.blockmap
latest.yml
The filename must be exactly:
latest.yml
Auto-updates will fail with a 404 if latest.yml is missing from the latest release.
If using Electron Builder direct publishing, set GH_TOKEN with release permissions and run:
npm run dist:publishClose the app first:
taskkill /IM "Balkon OBS Agent.exe" /FCheck:
- OBS Studio is open
- OBS WebSocket server is enabled
- port is
4455 - password matches the app configuration
- local URL is
ws://127.0.0.1:4455
Check:
- Relay URL is correct
- Agent ID is correct
- Agent Token is correct
- token was not rotated/revoked
- backend/relay is running
- firewall/proxy does not block outbound WebSocket connections
- Never commit real Agent Tokens.
- Never print full Agent Tokens in logs.
- Do not expose OBS WebSocket directly to the public internet.
- Prefer the relay + local agent model for production.
- Store secrets only in local app configuration or backend-managed secure storage.
Recommended demonstration flow:
- Open OBS Studio and enable WebSocket.
- Start Balkon OBS Agent.
- Save Relay URL, Agent ID, Agent Token and OBS WebSocket URL.
- Connect the agent.
- Confirm agent online status in Balkon Website Streamer Studio.
- Open OBS control in the website.
- Refresh scenes and switch scenes.
- Trigger a source visibility or media action.
- Show OBS history in the website.
This demonstrates the complete chain:
website → backend → relay → OBS Agent → OBS Studio