{"id":22821931,"url":"https://github.com/z-bj/chatsocket","last_synced_at":"2026-04-15T14:31:30.446Z","repository":{"id":135481835,"uuid":"419644686","full_name":"z-bj/chatSocket","owner":"z-bj","description":"This is a simple chat application built using Socket.IO and Express. It allows users to connect to a server and chat with each other in real-time.","archived":false,"fork":false,"pushed_at":"2023-03-02T16:24:14.000Z","size":1395,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-21T11:06:16.101Z","etag":null,"topics":["express","nodejs","socket-io"],"latest_commit_sha":null,"homepage":"https://z-bj.github.io/chatSocket","language":"HTML","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/z-bj.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":"2021-10-21T08:38:26.000Z","updated_at":"2023-03-04T03:25:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"2b21a137-ec75-4df9-b845-3f182d293105","html_url":"https://github.com/z-bj/chatSocket","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/z-bj/chatSocket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-bj%2FchatSocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-bj%2FchatSocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-bj%2FchatSocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-bj%2FchatSocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/z-bj","download_url":"https://codeload.github.com/z-bj/chatSocket/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-bj%2FchatSocket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31845491,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T13:28:40.153Z","status":"ssl_error","status_checked_at":"2026-04-15T13:28:29.396Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["express","nodejs","socket-io"],"created_at":"2024-12-12T16:09:48.755Z","updated_at":"2026-04-15T14:31:30.419Z","avatar_url":"https://github.com/z-bj.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Socket.IO Chat App\n\n![alt text](https://i.ibb.co/fv11Yhh/2021-10-21-09-53-51-server-js-socket-WSL-Ubuntu-20-04-Visual-Studio-Code.jpg)\n\n\n\u003e This is a simple chat application built using Socket.IO and Express.\u003cbr\u003eIt allows users to connect to a server and chat with each other in real-time.\n\n## Features\n\n-   Real-time communication between multiple clients\n-   Simple and intuitive user interface\n-   Automatic scrolling to the bottom of the chat window\n-   Easy to use and modify\n\n![Node.js](https://img.shields.io/badge/Node.js-43853d?style=flat-square\u0026logo=node.js\u0026logoColor=white)\n![Express.js](https://img.shields.io/badge/Express.js-000000?style=flat-square\u0026logo=express\u0026logoColor=white)\n![Socket.io](https://img.shields.io/badge/Socket.io-010101?style=flat-square\u0026logo=socket.io\u0026logoColor=white)\n![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?style=flat-square\u0026logo=javascript\u0026logoColor=black)\n\n\n## How It Works\n\nThe server uses Express to serve the `index.html` file and Socket.IO to handle incoming connections and messages. When a user connects to the server, a `connection` event is fired and a callback function is called, which logs a message to the console. Similarly, when a user disconnects, a `disconnect` event is fired and a message is logged to the console. Finally, when a user sends a chat message, a `chat message` event is fired and the message is broadcast to all connected users.\n\n\n\n## Installation\n\nTo get started, clone the repository and install the required dependencies using `npm`:\n\n``` bash\ngit clone https://github.com/yourusername/socket-io-chat.git\ncd socket-io-chat\nnpm install\n```\n\n## Usage\n\nClient-side [link](https://z-bj.github.io/chatSocket)\n\nStart the server using the following command:\n\n``` bash\nnode server.js\n\n```\n\n\nThen, open a web browser and navigate to `http://localhost:3000` to view the chat app.\n\n## Code Overview\n\nThe client code is located in `index.html`. It uses the Socket.IO client library to establish a connection to the server and send and receive messages.\nThe server code is located in `server.js`. It initializes an Express app and creates an HTTP server using the app. Socket.IO is then initialized with the HTTP server.\nHere's a brief overview of what the code does:\n\n``` javascript\nconst app = require(\"express\")();\nconst http = require(\"http\").Server(app);\nconst io = require(\"socket.io\")(http);\n\n// Serve the index.html file\napp.get(\"/\", function (req, res) {\n  res.sendFile(__dirname + \"/index.html\");\n});\n\n// Handle incoming connections\nio.on(\"connection\", function (socket) {\n  console.log(\"a user is connected\");\n\n  // Handle disconnections\n  socket.on(\"disconnect\", function () {\n    console.log(\"a user is disconnected\");\n  });\n\n  // Handle incoming chat messages\n  socket.on(\"chat message\", function (msg) {\n    console.log(\"received message : \" + msg);\n    io.emit(\"chat message\", msg);\n  });\n});\n\n// Start the server\nhttp.listen(3000, function () {\n  console.log(\"Server running on 3000\");\n});\n\n```\n\n\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz-bj%2Fchatsocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fz-bj%2Fchatsocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz-bj%2Fchatsocket/lists"}