{"id":13730243,"url":"https://github.com/ggerganov/incppect","last_synced_at":"2025-04-26T23:38:08.114Z","repository":{"id":54170534,"uuid":"183480681","full_name":"ggerganov/incppect","owner":"ggerganov","description":"Inspect C++ memory in the browser","archived":false,"fork":false,"pushed_at":"2022-05-08T15:08:09.000Z","size":90,"stargazers_count":97,"open_issues_count":2,"forks_count":19,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-26T19:39:19.656Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ggerganov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-25T17:30:46.000Z","updated_at":"2025-03-16T11:11:41.000Z","dependencies_parsed_at":"2022-08-13T08:10:59.369Z","dependency_job_id":null,"html_url":"https://github.com/ggerganov/incppect","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggerganov%2Fincppect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggerganov%2Fincppect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggerganov%2Fincppect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggerganov%2Fincppect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ggerganov","download_url":"https://codeload.github.com/ggerganov/incppect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251051413,"owners_count":21528787,"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":[],"created_at":"2024-08-03T02:01:12.069Z","updated_at":"2025-04-26T23:38:08.097Z","avatar_url":"https://github.com/ggerganov.png","language":"C++","readme":"[![Actions Status](https://github.com/ggerganov/incppect/workflows/CI/badge.svg)](https://github.com/ggerganov/incppect/actions)\n\n# incppect\n\nInspect C++ memory in the browser\n\n## Description\n\nThis is a small library that allows a C++ native application to stream memory bits to one or more websocket clients. This functionality can be used to conveniently inspect the internal state of the native application from a browser.\n\nIncppect starts a simple HTTP(S)/WebSocket server in your application that accepts external connections. When a client connects, incppect serves the static content (HTML/JS) from a user-specified location, as well as the built-in incppect JS client [incppect.js](https://github.com/ggerganov/incppect/blob/master/src/incppect.js). The client opens a websocket connection back to the application and starts requesting custom data. The data is streamed back to the client over the websocket. The usage/visualization of the received data is entirely up to the client.\n\nThe HTTP(S)/WebSocket server is implemented via the [uWebSocket](https://github.com/uNetworking/uWebSockets) library (included in the project as a submodule).\n\n## Examples:\n\n\u003ca href=\"https://i.imgur.com/8hJSbzQ.gif\" target=\"_blank\"\u003e![incppect-balls2d](https://i.imgur.com/8hJSbzQ.gif)\u003c/a\u003e\n\nCheckout the [examples](https://github.com/ggerganov/incppect/tree/master/examples) folder for more samples.\n\nOther projects:\n- [imgui-ws](https://github.com/ggerganov/imgui-ws) - Dear ImGui over WebSockets\n- [typing-battles](https://github.com/ggerganov/typing-battles) - A multiplayer typing game\n\n## Sample usage (HTTP):\n\nExample: [hello-browser](https://github.com/ggerganov/incppect/tree/master/examples/hello-browser)\n\nIn your C++ program add something along these lines:\n\n```cpp\n#include \"incppect/incppect.h\"\n\n// start the web server in a dedicated thread\nauto \u0026 incppect = Incppect\u003cfalse\u003e::getInstance();\nincppect.runAsync(...);\n\nint32_t some_var;\nfloat some_arr[10];\n    \n// define variables that can be requested from the web clients\nincppect.var(\"path0\", [\u0026](auto ) { return Incppect\u003cfalse\u003e::view(some_var); });\nincppect.var(\"path1[%d]\", [\u0026](auto idxs) { return Incppect\u003cfalse\u003e::view(some_arr[idxs[0]]); });\n\n```\n\nIn your web client:\n\n```js\n\u003cscript src=\"incppect.js\"\u003e\u003c/script\u003e\n\n\u003cscript\u003e\n    incppect.render = function() {\n        // request C++ data\n        var some_var = this.get_int32('path0');\n        var some_arr_element = this.get_int32_arr('path1[%d]', 5);\n        \n        // do something with it\n        ...\n    }\n    \n    incppect.init();\n\u003c/script\u003e\n\n```\n\n## Sample usage (HTTPS):\n\nExample: [hello-browser-ssl](https://github.com/ggerganov/incppect/tree/master/examples/hello-browser-ssl)\n\nIn your C++ program add something along these lines:\n\n```cpp\n#include \"incppect/incppect.h\"\n\n// start the web server in a dedicated thread\nauto \u0026 incppect = Incppect\u003ctrue\u003e::getInstance();\n\n// provide valid SSL certificate\nincppect::Parameters parameters;\nparameters.sslKey = \"key.pem\";\nparameters.sslCert = \"cert.pem\";\n\nincppect.runAsync(parameters);\n\nint32_t some_var;\nfloat some_arr[10];\n    \n// define variables that can be requested from the web clients\nincppect.var(\"path0\", [\u0026](auto ) { return Incppect\u003ctrue\u003e::view(some_var); });\nincppect.var(\"path1[%d]\", [\u0026](auto idxs) { return Incppect\u003ctrue\u003e::view(some_arr[idxs[0]]); });\n\n```\n\nIn your web client:\n\n```js\n\u003cscript src=\"incppect.js\"\u003e\u003c/script\u003e\n\n\u003cscript\u003e\n    incppect.render = function() {\n        // request C++ data\n        var some_var = this.get_int32('path0');\n        var some_arr_element = this.get_int32_arr('path1[%d]', 5);\n        \n        // do something with it\n        ...\n    }\n    \n    // notice we use secure web-socket\n    incppect.ws_uri = 'wss://' + window.location.hostname + ':' + window.location.port + '/incppect';\n    \n    incppect.init();\n\u003c/script\u003e\n\n```\n\n## Build instructions\n\n**Linux and Mac OS**\n\n```bash\ngit clone https://github.com/ggerganov/incppect\ncd incppect\ngit submodule update --init\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n```\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fggerganov%2Fincppect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fggerganov%2Fincppect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fggerganov%2Fincppect/lists"}