{"id":18368759,"url":"https://github.com/openbmc/jsnbd","last_synced_at":"2025-10-23T17:18:56.236Z","repository":{"id":56013349,"uuid":"149308100","full_name":"openbmc/jsnbd","owner":"openbmc","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-04T11:45:42.000Z","size":623,"stargazers_count":7,"open_issues_count":2,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-15T20:53:14.792Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"M4","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openbmc.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-09-18T15:08:34.000Z","updated_at":"2025-02-13T08:26:29.000Z","dependencies_parsed_at":"2024-11-05T23:29:08.308Z","dependency_job_id":"0f3fdc70-fd72-4d74-9c18-31172bda5dec","html_url":"https://github.com/openbmc/jsnbd","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/openbmc%2Fjsnbd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fjsnbd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fjsnbd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fjsnbd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openbmc","download_url":"https://codeload.github.com/openbmc/jsnbd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281427,"owners_count":21077423,"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-11-05T23:27:20.129Z","updated_at":"2025-10-23T17:18:51.210Z","avatar_url":"https://github.com/openbmc.png","language":"M4","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nbd-proxy\n\nPrototype javascript+websocket NBD server; this code demonstrates a javascript\nNBD implementation connected to the kernel nbd device over a websocket.\n\nThere are two components here:\n\nnbd-proxy: a little binary to initialise a nbd client, connected to a unix\ndomain socket, then proxy data between that socket and stdio. This can be used\nwith a websocket proxy to expose that stdio as a websocket.\n\nnbd.js: a javascript implementation of a NBD server.\n\n## Running\n\nYou'll need a websocket proxy This connects the nbd-proxy component to a\nwebsocket endpoint.\n\nFor experimentation, I use the `websocketd` infrastrcture to expose the\nwebsocket endpoint, plus serve the static HTML+js client:\n\n    git clone https://github.com/joewalnes/websocketd\n    (cd websocketd \u0026\u0026 make)\n\n    sudo websocketd/websocketd --port=8000 --staticdir=web --binary ./nbd-proxy \u003cconfig\u003e\n\n- where `\u003cconfig\u003e` is a name of a configuration in the config.json file.\n\nNote that this type of invocation is very insecure, and intended just for\nexperimentation. See the Security section below.\n\nFor real deployments, you want your websocket-enabled service to run nbd-proxy,\nand connect its stdio to a websocket, running in binary mode. Your web interface\nwill interact with this using an instance of the NBDServer object (defined in\nweb/js/nbd.js):\n\n    var server = NBDServer(endpoint, file);\n    server.start();\n\n- where endpoint is the websocket URL (ws://...) and file is a File object. See\n  web/index.html for an example.\n\n## Security\n\nThis code allows potentially-untrusted clients to export arbitrary block device\ndata to your kernel. Therefore, you should ensure that only trusted clients can\nconnect as NBD servers.\n\nThere is no authentication or authorisation implemented in the nbd proxy. Your\nwebsocket proxy should implement proper authentication before nbd-proxy is\nconnected to the websocket endpoint.\n\n## State hook\n\nThe nbd-proxy has a facility to run an program on state change. When a nbd\nsession is established or shut down, the proxy will run the executable at\n/etc/nbd-proxy/state.\n\nThis executable is called with two arguments: the action (\"start\" or \"stop\"),\nand the name of the configuration (as specified in the config.json file).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenbmc%2Fjsnbd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenbmc%2Fjsnbd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenbmc%2Fjsnbd/lists"}