{"id":25872159,"url":"https://github.com/flameart/websocket-core","last_synced_at":"2026-05-13T03:32:47.089Z","repository":{"id":126752439,"uuid":"221059297","full_name":"FlameArt/websocket-core","owner":"FlameArt","description":"Easy websocket framework with async auth, json-messages and user model","archived":false,"fork":false,"pushed_at":"2020-07-13T19:46:41.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-17T06:46:05.007Z","etag":null,"topics":["async","authentication","authorization","nodejs","ping-pong","websocket","websocket-server"],"latest_commit_sha":null,"homepage":null,"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/FlameArt.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":"2019-11-11T19:57:39.000Z","updated_at":"2020-07-13T19:46:43.000Z","dependencies_parsed_at":"2023-06-17T22:31:14.135Z","dependency_job_id":null,"html_url":"https://github.com/FlameArt/websocket-core","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.4285714285714286,"last_synced_commit":"b437575985a115c976870ae38fe0f5fa86e2d362"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlameArt%2Fwebsocket-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlameArt%2Fwebsocket-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlameArt%2Fwebsocket-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlameArt%2Fwebsocket-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FlameArt","download_url":"https://codeload.github.com/FlameArt/websocket-core/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241476382,"owners_count":19968905,"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":["async","authentication","authorization","nodejs","ping-pong","websocket","websocket-server"],"created_at":"2025-03-02T07:39:48.225Z","updated_at":"2026-05-13T03:32:47.045Z","avatar_url":"https://github.com/FlameArt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebSockets\n\nWebsocket mini-framework for fast start work with many-clients and process messages on `Node.js`\n\n    npm install --save FlameArt/websocket-core\n\n## Features\n* Run websocket server and work with json-messages in 3 lines of code\n* **Multiply users model** with session per each\n* All messages in json with `type` for each action\n* **Authentication model**: by default with any login and pass.\n* You can create you own async authentication and authorization  methods\n* Automatic **Ping-Pong** all clients and normal close dirty-disconnected users\n* Send message to all clients or override with you own filter\n* Lib has not map, filters and other slowly methods, but you can use it\n\n## Getting started\n\nJust extend `WebSocketCore` and override handlers:\n\n```\nconst WebSocketCore = require(\"websocket-core\");\n\nclass MyWebSocket extends WebSocketCore {\n\t\n\tasync getMessage(json, user, rawdata) {\n\t\t\n\t\tconsole.log(\"Detected message from user #\" + user.ID + \"/\" + user.ip + \" [\" + json.type + \"] \" + rawdata);\n\t\t\n\t\t// Send to that client\n\t\tuser.WebSocket.send(\"Hello, newbie! Your session now is \" + user.session);\n\t\t\n\t\t// Send to all clients\n\t\tthis.sendAllUsers(\"Welcome to our new user #\" + user.ID);\n\t\t\n\t\t// Message correct\n\t\treturn true;\n\t\t\n\t}\n\n}\n\n// Run websocket on port 7000\nconst MyWS = new MyWebSocket();\nMyWS.start(7000);\n\n```\n\n## Custom auth method\n\nJust override `WebSocketCore-\u003eauthPure` method and set `WebSocketCore.useCustomAuth = true`\n\n\tasync authPure(login, passw, session) {\n\t\t// return auth result: user info, if success, and false if auth failed\n\t\treturn login === passw ? {UserID: 'UserWithCoolPassw'} : false;\n\t}\n\nUser info will be stored in `user.info`\n\n## License\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflameart%2Fwebsocket-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflameart%2Fwebsocket-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflameart%2Fwebsocket-core/lists"}