{"id":19272111,"url":"https://github.com/ogstudio/debug-broker","last_synced_at":"2025-07-01T04:05:41.991Z","repository":{"id":92278388,"uuid":"137329153","full_name":"OGStudio/debug-broker","owner":"OGStudio","description":"Mediator to achieve remote debugging across platforms","archived":false,"fork":false,"pushed_at":"2018-09-24T08:30:15.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T20:31:35.886Z","etag":null,"topics":["debugger","debugging","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OGStudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-14T08:28:18.000Z","updated_at":"2018-09-24T08:30:17.000Z","dependencies_parsed_at":"2023-06-08T06:15:40.395Z","dependency_job_id":null,"html_url":"https://github.com/OGStudio/debug-broker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OGStudio/debug-broker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OGStudio%2Fdebug-broker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OGStudio%2Fdebug-broker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OGStudio%2Fdebug-broker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OGStudio%2Fdebug-broker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OGStudio","download_url":"https://codeload.github.com/OGStudio/debug-broker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OGStudio%2Fdebug-broker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262893636,"owners_count":23380710,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugger","debugging","nodejs"],"created_at":"2024-11-09T20:35:26.368Z","updated_at":"2025-07-01T04:05:41.959Z","avatar_url":"https://github.com/OGStudio.png","language":"JavaScript","readme":"# Table of contents\n\n* [Overview](#overview)\n* [Debug protocol](#protocol)\n    * [Application side](#app-side)\n    * [Debug UI side](#ui-side)\n* [Internal logic](#logic)\n    * [Value prioritization](#values)\n    * [HTTP requests](#requests)\n* [Installation](#installation)\n    * [Localhost](#localhost)\n    * [Heroku](#heroku)\n* [Installation verification](#verification)\n* [Debug UI](#debug-ui)\n* [Sample application](#application)\n\n\u003ca name=\"overview\"/\u003e\n\n# Overview\n\ndebug-broker\n\n* was created to simplify debugging of cross-platform applications that run on desktop, mobile, and web\n* is a mediator between debugged application and debug UI\n* is a [Node.js][nodejs] server\n* should be hosted on a dedicated server\n\n\u003ca name=\"protocol\"/\u003e\n\n# Debug protocol\n\nSince `debug-broker` is a mediator between application and debug UI, both\napplication and debug UI should exchange messages using the same protocol.\n\n\u003ca name=\"app-side\"/\u003e\n\n## Application side\n\nApplication publishes available debug information for `debug-broker` to\ncontrol. Here's how sample application side JSON looks like:\n\n```\n{\n  \"title\": \"Ex03\",\n  \"pages\": [\n    {\n      \"title\": \"camera\",\n      \"items\": [\n        {\n          \"title\": \"BGColor\",\n          \"value\": \"51,51,102\",\n          \"isWritable\": 1\n        },\n        {\n          \"title\": \"Position/Rotation\",\n          \"value\": \"0.000000,-6.883219,0.000000/90.000000,0.000000,-0.000000\",\n          \"isWritable\": 0\n        }\n      ]\n    }\n  ]\n}\n\n```\n\nApplications may host one or more so-called debuggers. Debugger is a\ncontainer of so-called debug pages.\n\nIn this case, we have:\n\n* single debugger named `Ex03`.\n* single debug page named `camera`.\n\nDebug pages contain items to debug.\n\nIn this case, `camera` items are:\n\n* `BGColor`\n    * with a value of `51,51,102`\n    * the value is read-write\n* `Position/Rotation`\n    * with a value of `0.000000,-6.883219,0.000000/90.000000,0.000000,-0.000000`\n    * the value is read-only\n\n\u003ca name=\"ui-side\"/\u003e\n\n## Debug UI side\n\nDebug UI either queries debug page items, or alters debug page item(s).\n\nHere's how debug UI query JSON looks like:\n\n```\n{\n  \"title\": \"Ex03\"\n}\n```\n\nHere's how debug UI alteration JSON looks like:\n\n```\n{\n  \"title\": \"Ex03\",\n  \"pages\": [\n    {\n      \"title\": \"camera\",\n      \"items\": [\n        {\n          \"title\": \"BGColor\",\n          \"value\": \"0,0,0\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n\u003ca name=\"logic\"/\u003e\n\n# Internal logic\n\n\u003ca name=\"values\"/\u003e\n\n## Value prioritization\n\nWe have both application and debug UI sending values to `debug-broker`. Which\nvalue does `debug-broker` prefer? `debug-broker` accepts complete new items\nfrom Application, and values from UI.\n\n\u003ca name=\"requests\"/\u003e\n\n## HTTP requests\n\n`debug-broker` only accepts POST requests with a body as JSON listed above.\n`7999` port is used by default.\n\nIf sent message contains `isWritable` property, such message is considered to\noriginate from application. Otherwise, from debug UI.\n\nOnce message has been received and processed, `debug-broker` returns\nmessage containing values that are now valid.\n\n\u003ca name=\"installation\"/\u003e\n\n# Installation\n\n[Node.js][nodejs] is the only dependency of `debug-broker`. So you only need to have\nNode.js to run `debug-broker`.\n\n\u003ca name=\"localhost\"/\u003e\n\n## Localhost\n\nTo start `debug-broker`, run the following command:\n\n```\n$ node index.js\n```\n```\nServer listening at port 7999\n```\n\n**Notes**:\n\n* localhost is usually unreachable by Android emulators and iOS devices\n* we recommend to host `debug-broker` at a machine available to all your devices\n\n\u003ca name=\"heroku\"/\u003e\n\n## Heroku\n\n[Heroku][heroku] provides free hosting for Node.js apps. If you host\n`debug-broker` there, you can access `debug-broker` from virtually anywhere.\n\n**Warning**: `debug-broker` has no authentication, so anyone would be able to\naccess your `debug-broker` instance.\n\n**Note**: read [Getting started with Node.js][heroku-nodejs-bootstrap] guide to understand how to deploy Node.js applications to Heroku.\n\nHere's a brief information on how to host `debug-broker` at Heroku:\n\n* go to `debug-broker` directory\n\n    ```\n    $ cd /path/to/debug-broker\n    ```\n\n* create Heroku application\n\n    ```\n    $ heroku create app-name\n    ```\n    ```\n    Creating ⬢ app-name... done\n    https://app-name.herokuapp.com/ | https://git.heroku.com/app-name.git\n    ```\n\n* deploy `debug-broker` application:\n\n    ```\n    $ git push heroku master\n    ```\n\n\u003ca name=\"verification\"/\u003e\n\n# Installation verification\n\nRun the following command:\n\n```\n$ curl \u003cdebug-broker-http(s)-address\u003e\n```\n\nYou should get `DebugBroker` as a response to GET request.\n\n\u003ca name=\"debug-ui\" /\u003e\n\n# Debug UI\n\nDebug UI implemented as an HTML page is available [here][debug-ui].\n\n\u003ca name=\"application\" /\u003e\n\n# Sample application\n\nSample application that you can alter using this debug UI is available [here][osgcpe-04].\n\n[nodejs]: https://nodejs.org\n[heroku]: https://www.heroku.com\n[heroku-nodejs-bootstrap]: https://devcenter.heroku.com/articles/getting-started-with-nodejs\n[debug-ui]: https://github.com/OGStudio/debug-ui\n[osgcpe-04]: https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/04.RemoteDebugging\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fogstudio%2Fdebug-broker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fogstudio%2Fdebug-broker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fogstudio%2Fdebug-broker/lists"}