{"id":23678580,"url":"https://github.com/erickgbr/ws-library","last_synced_at":"2026-04-26T16:32:39.417Z","repository":{"id":192265706,"uuid":"403474343","full_name":"ErickGBR/ws-library","owner":"ErickGBR","description":"Simple structure of native webSockets server, similar to socket.io but with eco WebSockets ( web sockets from the backend)","archived":false,"fork":false,"pushed_at":"2023-10-08T18:47:01.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-21T15:54:27.222Z","etag":null,"topics":["back-end","node","node-js","real-time","server","websocket","ws"],"latest_commit_sha":null,"homepage":"","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/ErickGBR.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-09-06T03:33:15.000Z","updated_at":"2023-09-02T16:35:22.000Z","dependencies_parsed_at":"2024-12-29T15:44:00.054Z","dependency_job_id":null,"html_url":"https://github.com/ErickGBR/ws-library","commit_stats":null,"previous_names":["erickgbr/ws-library"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ErickGBR/ws-library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErickGBR%2Fws-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErickGBR%2Fws-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErickGBR%2Fws-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErickGBR%2Fws-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ErickGBR","download_url":"https://codeload.github.com/ErickGBR/ws-library/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErickGBR%2Fws-library/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32305035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"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":["back-end","node","node-js","real-time","server","websocket","ws"],"created_at":"2024-12-29T15:33:41.572Z","updated_at":"2026-04-26T16:32:39.392Z","avatar_url":"https://github.com/ErickGBR.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backend Web Socket\nSimple structure of native webSockets server, similar to socket.io but with eco WebSockets ( web sockets from the backend)\nyou can set, connect client server between 2 backend servers and communicate as one client server and the other server, you can communicate between 2 servers in real time,\nthrough the WebSockets protocol, not http, free of DDoS attacks or http vulnerabilities.\n\n## Introduction\n\nThe **ws eco** library is a WebSocket utility designed for backend-to-backend communication. It enables easy event-based communication between different parts of your backend server. This README will guide you through installing and using the library.\n\n## Getting Started\n\n### Prerequisites\n\nBefore you can start using the **ws eco** library, you need to ensure you have Node.js and npm (Node Package Manager) installed on your system.\n\n### Installation\n\nTo install the library, follow these steps:\n\n1. Clone the repository to your local machine.\n2. Navigate to the project directory in your terminal.\n\n```bash\ncd your-project-directory\n```\n\n3. Run the following command to install the required dependencies:\n\n```bash\nnpm install\n```\n\n### Configuration\n\nBefore running the project, you'll need to set up the necessary environment variables. Refer to the `example.env` file provided in the project. Copy its contents and create a `.env` file in the project root. Populate this `.env` file with your desired environment variables.\n\n### Starting the Project\n\nYou can start the project using the following command:\n\n```bash\nnpm start\n```\n\nThis will start the server, and you can access it at [http://localhost:80](http://localhost:80).\n\n### Backend-to-Backend Communication\n\nThe **ws eco** library allows you to send WebSocket events from one part of your backend to another. To achieve this, you can use the `ws_backend_eco.js` module located in the `server_ws` folder.\n\nHere's an example of how to use it:\n\n```javascript\nconst wsBackendEco = require('./server_ws/ws_backend_eco.js');\n\nconst socket = wsBackendEco(ws);\n\nsocket.on('customEvent', (data) =\u003e {\n  console.log('Received customEvent with data:', data);\n});\n\n// To emit an event to another backend component:\nsocket.emit('customEvent', { message: 'Hello from backend!' });\n```\n\nMake sure you import and use this module appropriately in your backend components.\n\n### Example Usage\n\nYou can find an example of how to use the **ws eco** library in the `controller_eco.js` file located in the `controller` folder. This example demonstrates how to send and receive WebSocket events within your backend components.\n\nAdditionally, in the `public` folder, you'll find the JavaScript files needed for sending and receiving events from the frontend.\n\nFeel free to explore and adapt these examples to your specific use case.\n\n## Conclusion\n\nThe **ws eco** library simplifies backend-to-backend communication using WebSocket events. By following the installation and configuration steps mentioned above, you can easily incorporate it into your project and facilitate seamless event-based communication within your backend components.\n\nIf you have any questions or encounter any issues, please refer to the project's GitHub repository for further assistance.\n\n---\n\nMake sure to replace `\"your-project-directory\"` with the actual directory of your project and provide additional details or documentation as needed for your specific use case.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferickgbr%2Fws-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferickgbr%2Fws-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferickgbr%2Fws-library/lists"}