{"id":23552716,"url":"https://github.com/meething/gundb-multisocket","last_synced_at":"2025-09-07T14:41:22.434Z","repository":{"id":45131095,"uuid":"256210877","full_name":"meething/gundb-multisocket","owner":"meething","description":"Multiple GunDB sockets sharing a single HTTP/S server :fork_and_knife:","archived":false,"fork":false,"pushed_at":"2022-01-06T12:37:05.000Z","size":477,"stargazers_count":22,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T10:11:25.826Z","etag":null,"topics":["cluster","distributed","gun","gunsb","p2p","server","websocket","ws"],"latest_commit_sha":null,"homepage":"https://meething-webrtc-gun.glitch.me/","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/meething.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}},"created_at":"2020-04-16T12:39:00.000Z","updated_at":"2024-08-01T02:56:53.000Z","dependencies_parsed_at":"2022-09-02T23:10:25.100Z","dependency_job_id":null,"html_url":"https://github.com/meething/gundb-multisocket","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/meething%2Fgundb-multisocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meething%2Fgundb-multisocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meething%2Fgundb-multisocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meething%2Fgundb-multisocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meething","download_url":"https://codeload.github.com/meething/gundb-multisocket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251321948,"owners_count":21570825,"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":["cluster","distributed","gun","gunsb","p2p","server","websocket","ws"],"created_at":"2024-12-26T11:13:02.644Z","updated_at":"2025-04-28T13:47:41.072Z","avatar_url":"https://github.com/meething.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://i.imgur.com/XS79fTC.png\" width=200\u003e \u003cimg width=\"100\" alt=\"mozilla-builders\" src=\"https://user-images.githubusercontent.com/1423657/81992335-85346480-9643-11ea-8754-8275e98e06bc.png\"\u003e\n\n#### Gun MultiSocket\nSingle `HTTP/S` server providing multiple ephemeral [GunDB](https://gun.eco) `WebSocket` instances with  path based routing and mesh isolation.\n\n### Notes\n* uses its own [mem](https://github.com/meething/gundb-multisocket/blob/master/mem.js) storage adaptor to avoid any disk writes\n* uses its own [websockets](https://github.com/meething/gundb-multisocket/blob/master/gun-ws.js) adaptor allowing injection into Gun contructors\n* MUST be served through SSL and can easily be deployed on [glitch](https://glitch.com/~gundb-multiserver) and other platforms.\n\n### Configuration\n* requires a valid set of SSL/TLS certificates _(letsencrypt)_\n\n### Installation\n```\nnpm install\n```\n\n### Usage\n#### npm\nExplode your ENV variables manually and launch using npm:\n```\nSSL=true SSLKEY=/path/to/privkey.pem SSLCERT=/path/to/fullchain.pem npm start\n```\n#### pm2\nConfigure the options in `multisocket.config.js` and launch using pm2:\n```\npm2 start multisocket.config.js\n```\n\n[![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg)](https://glitch.com/edit/#!/import/github/https://github.com/meething/gundb-multisocket/gundb-multisocket)\n\n#### Gun WS Flow\n\n\u003cimg src=\"https://user-images.githubusercontent.com/1423657/79556065-d4b55e00-80a0-11ea-8a6a-b85aa0c90cf0.png\" width=500/\u003e\n\n#### Practical Example\nIn this example we want the data of Jack and Jill to be partitioned and not shared between different ws /paths\n```\nlocalStorage.clear();\n\n// Create the first gun endpoint\nvar random1 = Math.random().toString(36).substring(7);\nvar gun1 = Gun({peers:[\"https://gundb-multiserver.glitch.me/\"+random1], musticast: false, localStorage: false, radisk: false, file: false});\n// Create Jack\ngun1.get('jack').put({ name: \"Jack\" });\n\n// This should be triggered for Jack only\ngun1.get('jack').on(function(data, key){\n  console.log(\"gun 1 update:\", data);\n});\n// This should never be triggered! It's from Jill after all.\ngun1.get('jill').on(function(data, key){\n  console.log(\"Jack should NOT see Jill's update\", data);\n});\n\n// Create the second gun endpoint\nvar random2 = Math.random().toString(36).substring(7);\nvar gun2 = Gun({peers:[\"https://gundb-multiserver.glitch.me/\"+random2], multicast: false, localStorage: false, radisk: false, file: false});\n// Create Jill\ngun2.get('jill').put({ name: \"Jill\"});\n// This should be triggered for Jill only\ngun2.get('jill').on(function(data, key){\n  console.log(\"gun 2 update:\", data);\n});\n```\n\n###### Credits\nThis project is a component of [Gun Meething](https://github.com/meething/webrtc-gun) powered by [GunDB](https://gun.eco)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeething%2Fgundb-multisocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeething%2Fgundb-multisocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeething%2Fgundb-multisocket/lists"}