{"id":13407007,"url":"https://github.com/socketio/socket.io-admin-ui","last_synced_at":"2025-04-08T08:15:53.346Z","repository":{"id":38261361,"uuid":"358212725","full_name":"socketio/socket.io-admin-ui","owner":"socketio","description":"Admin UI for Socket.IO","archived":false,"fork":false,"pushed_at":"2024-03-24T23:18:07.000Z","size":4654,"stargazers_count":377,"open_issues_count":29,"forks_count":101,"subscribers_count":9,"default_branch":"develop","last_synced_at":"2025-04-01T07:40:35.031Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://admin.socket.io","language":"Vue","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/socketio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2021-04-15T10:07:15.000Z","updated_at":"2025-03-27T11:50:23.000Z","dependencies_parsed_at":"2024-01-18T23:05:39.454Z","dependency_job_id":"d65e6466-5fd9-4dcd-a7aa-fe487daadfbb","html_url":"https://github.com/socketio/socket.io-admin-ui","commit_stats":{"total_commits":52,"total_committers":12,"mean_commits":4.333333333333333,"dds":"0.23076923076923073","last_synced_commit":"158864989dddeba67df9975a4cad48ef310f8c80"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-admin-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-admin-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-admin-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-admin-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socketio","download_url":"https://codeload.github.com/socketio/socket.io-admin-ui/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305932,"owners_count":20917208,"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-07-30T19:02:45.634Z","updated_at":"2025-04-08T08:15:53.324Z","avatar_url":"https://github.com/socketio.png","language":"Vue","funding_links":[],"categories":["Vue"],"sub_categories":[],"readme":"# Socket.IO Admin UI\n\n![dashboard screenshot](assets/dashboard.png)\n\n## Table of contents\n\n- [How to use](#how-to-use)\n  - [Server-side](#server-side)\n  - [Client-side](#client-side)\n- [Available options](#available-options)\n  - [`auth`](#auth)\n  - [`namespaceName`](#namespacename)\n  - [`readonly`](#readonly)\n  - [`serverId`](#serverid)\n  - [`store`](#store)\n  - [`mode`](#mode)\n- [How it works](#how-it-works)\n- [License](#license)\n\n## How to use\n\n### Server-side\n\nFirst, install the `@socket.io/admin-ui` package:\n\n```\nnpm i @socket.io/admin-ui\n```\n\nAnd then invoke the `instrument` method on your Socket.IO server:\n\n```js\nconst { createServer } = require(\"http\");\nconst { Server } = require(\"socket.io\");\nconst { instrument } = require(\"@socket.io/admin-ui\");\n\nconst httpServer = createServer();\n\nconst io = new Server(httpServer, {\n  cors: {\n    origin: [\"https://admin.socket.io\"],\n    credentials: true\n  }\n});\n\ninstrument(io, {\n  auth: false\n});\n\nhttpServer.listen(3000);\n```\n\nThe module is compatible with:\n\n- Socket.IO v4 server\n- Socket.IO v3 server (\u003e= 3.1.0), but without the operations on rooms (join, leave, disconnection)\n\n### Client-side\n\nYou can then head up to https://admin.socket.io, or host the files found in the `ui/dist` folder.\n\n**Important note**: the website at https://admin.socket.io is totally static (hosted on [Vercel](https://vercel.com)), we do not (and will never) store any information about yourself or your browser (no tracking, no analytics, ...). That being said, hosting the files yourself is totally fine.\n\nYou should see the following modal:\n\n![login modal screenshot](assets/login-modal.png)\n\nPlease enter the URL of your server (for example, `http://localhost:3000` or `https://example.com`) and the credentials, if applicable (see the `auth` option [below](#auth)).\n\n### Available options\n\n#### `auth`\n\nDefault value: `-`\n\nThis option is mandatory. You can either disable authentication (please use with caution):\n\n```js\ninstrument(io, {\n  auth: false\n});\n```\n\nOr use basic authentication:\n\n```js\ninstrument(io, {\n  auth: {\n    type: \"basic\",\n    username: \"admin\",\n    password: \"$2b$10$heqvAkYMez.Va6Et2uXInOnkCT6/uQj1brkrbyG3LpopDklcq7ZOS\" // \"changeit\" encrypted with bcrypt\n  },\n});\n```\n\nWARNING! Please note that the `bcrypt` package does not currently support hashes starting with the `$2y$` prefix, which is used by some BCrypt implementations (for example https://bcrypt-generator.com/ or https://www.bcrypt.fr/). You can check the validity of the hash with:\n\n```\n$ node\n\u003e require(\"bcrypt\").compareSync(\"\u003cthe password\u003e\", \"\u003cthe hash\u003e\")\ntrue\n```\n\nYou can generate a valid hash with:\n\n```\n$ node\n\u003e require(\"bcrypt\").hashSync(\"changeit\", 10)\n'$2b$10$LQUE...'\n```\n\nSee also:\n\n- https://github.com/kelektiv/node.bcrypt.js/issues/849\n- https://stackoverflow.com/a/36225192/5138796\n\n#### `namespaceName`\n\nDefault value: `/admin`\n\nThe name of the namespace which will be created to handle the administrative tasks.\n\n```js\ninstrument(io, {\n  namespaceName: \"/custom\"\n});\n```\n\nThis namespace is a classic Socket.IO namespace, you can access it with:\n\n```js\nconst adminNamespace = io.of(\"/admin\");\n```\n\nMore information [here](https://socket.io/docs/v4/namespaces/).\n\n#### `readonly`\n\nDefault value: `false`\n\nWhether to put the admin UI in read-only mode (no join, leave or disconnect allowed).\n\n```js\ninstrument(io, {\n  readonly: true\n});\n```\n\n#### `serverId`\n\nDefault value: `require(\"os\").hostname()`\n\nThe ID of the given server. If you have several Socket.IO servers on the same machine, please give them a distinct ID:\n\n```js\ninstrument(io, {\n  serverId: `${require(\"os\").hostname()}#${process.pid}`\n});\n```\n\n#### `store`\n\nDefault value: `new InMemoryStore()`\n\nThe store is used to store the session IDs so the user do not have to retype the credentials upon reconnection.\n\nIf you use basic authentication in a multi-server setup, you should provide a custom store:\n\n```js\nconst { instrument, RedisStore } = require(\"@socket.io/admin-ui\");\n\ninstrument(io, {\n  store: new RedisStore(redisClient)\n});\n```\n\n#### `mode`\n\nDefault value: `development`\n\nIn production mode, the server won't send all details about the socket instances and the rooms, thus reducing the memory footprint of the instrumentation.\n\n```js\ninstrument(io, {\n  mode: \"production\"\n});\n```\n\nThe production mode can also be enabled with the NODE_ENV environment variable:\n\n```\nNODE_ENV=production node index.js\n```\n\n## How it works\n\nYou can check the details of the implementation in the [lib/index.ts](lib/index.ts) file.\n\nThe `instrument` method simply:\n\n- creates a [namespace](https://socket.io/docs/v4/namespaces/) and adds an authentication [middleware](https://socket.io/docs/v4/middlewares/) if applicable\n- register listeners for the `connection` and `disconnect` event for each existing namespaces to track socket instances\n- register a timer which will periodically send stats from the server to the UI\n- register handlers for the `join`, `leave` and `_disconnect` commands sent from the UI\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketio%2Fsocket.io-admin-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocketio%2Fsocket.io-admin-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketio%2Fsocket.io-admin-ui/lists"}